Search found 1 match

by palashcse2k8
Fri Sep 12, 2014 6:34 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101978

Re: 10035 - Primary Arithmetic

why WA ???
please help...

#include <iostream>

using namespace std;

int main()
{
long long int a,b;
while (cin>>a>>b && a!=0 && b!=0)
{
int r=0,c=0;
while (a||b)
{
r = (a%10 + b%10 + r)/10;
a=a/10;
b=b/10;
c+=r;
}
if(c==0)
cout<<"No carry operation."<<endl;
else if (c==1)
cout<<c ...

Go to advanced search