Search found 3 matches
- Fri Jun 01, 2012 10:34 am
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101941
Re: 10035 - Primary Arithmetic... Why I got WA???
Thanks for pointing out the mistake. But after correction, it's still giving WA!
- Thu May 31, 2012 2:27 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101941
Re: 10035 - Primary Arithmetic... Why I got WA???
Please spot out the problem! I am not able to find any!
- Mon May 28, 2012 11:02 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101941
Re: 10035 - Primary Arithmetic... Why I got WA???
Why got WA? Giving correct output..
#include<stdio.h>
int main()
{
int i,j,temp,c=0, carry=0, a, b;
while(scanf("%d %d", &i, &j)==2)
{
if(i==0 && j==0)
{
break;
}
while((i!=0) || (j!=0))
{
a=i%10;
b=j%10;
if((carry+a+b)>9)
{
carry=(a+b)/10;
c++;
}
i=i/10;
j=j/10;
}
if(c==0 ...
#include<stdio.h>
int main()
{
int i,j,temp,c=0, carry=0, a, b;
while(scanf("%d %d", &i, &j)==2)
{
if(i==0 && j==0)
{
break;
}
while((i!=0) || (j!=0))
{
a=i%10;
b=j%10;
if((carry+a+b)>9)
{
carry=(a+b)/10;
c++;
}
i=i/10;
j=j/10;
}
if(c==0 ...