Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求各位牛人帮忙看一下啊,为什么WA啊

Posted by yuxinpei at 2009-10-30 18:28:06 on Problem 2562
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator