求出两个整数相除后的商。
注意:
如果分母为0,输出Error:the divisor cannot be 0.
否则输出Quotient is xxx
测试举例:
测试输入:3 0
预期输出:Error:the divisor cannot be 0.
测试输入:12 4
预期输出:Quotient is 3
#include <iostream>
using namespace std;
int main()
{
int a,b=0;
cin>>a>>b;
if(b==0)
{
cout<<"Error:the divisor cannot be 0."<<endl;
}
else
{
cout<<"Quotient is "<<a/b<<endl;
}
}