![:(](./images/smilies/icon_frown.gif)
Someone please give me some test input/output to test my program.
thanks...
Moderator: Board moderators
Code: Select all
234098720432984729 / 234923845
24324 / 2342
Code: Select all
0 / 2147483647 = 0
0 % 2147483647 = 0
2147483646 % 2147483647 = 2147483646
Code: Select all
#include <iostream.h>
#include <math.h>
#include <iomanip.h>
int main()
{long double a,b,result;
char ch;
while (cin>>a)
{cin>>ch;
while (ch!='/' && ch!='%') cin>>ch;
cin>>b;
if (ch=='/') result=a/b;
else result=fmod(a,b);
cout<<setiosflags(ios::fixed);
cout<<setprecision(0)<<result<<endl;
}
return 1;
}