HI我写这段代码让程序使用小于100的随机整数=>分开函数,返回qoutient和余数并将它们打印在输出中,但似乎我没有工作可以请你帮忙哪个部分是错的。除法函数随机整数需要商和余数打印出来
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
using namespace std;
int division(int& remainder,int qoutient)
{
int dividant;
int divisor;
int quotient=dividant/divisor;
int remainder=dividant%divisor;
}
int main()
{
int dividant =(rand()%99);
int divisor =(rand()%99);
int qoutient;
int remainder_result;
srand(time(NULL));
do{qoutient=division(dividant,divisor);
cout<<"this is q:"<<qoutient<<endl;
cout<<"remainder"<<remainder_result<<endl;}
while(dividant>divisor);
}
使多个帐户上张贴同样的问题,在你没好处。我建议你做一些研究,而不是泛滥计算器。 –