| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
求各位牛人帮忙看一下啊,为什么WA啊#include<stdio.h>
int main()
{
int c,d,carry;
unsigned a,b;
while(1){
c=0;
d=0;
carry=0;
a=1;
b=1;
scanf("%d%d",&a,&b);
if(a==0&&b==0) break;
while(a!=0||b!=0){
c=a%10;
d=b%10;
a=a/10;
b=b/10;
if(c+d>=10)
carry++;
}
if(carry==0)
printf("No carry operation.\n");
else
if(carry==1)
printf("1 carry operation.\n");
else
printf("%d carry operations.\n",carry);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator