标签:技术分享 png 算数 image scanf 技术 images += int
1 #include<cstdio> 2 int main() 3 { 4 int a,b; 5 while(scanf("%d%d",&a,&b)==2) 6 { 7 if(a==0 && b==0) break; 8 int c=0, ans=0; 9 while(a!=0 || b!=0) 10 { 11 c = (a%10 + b%10 +c) > 9 ? 1:0; 12 ans += c; 13 a/=10; b/=10; 14 } 15 if(ans>1) printf("%d carry operations.\n",ans); 16 else if(ans==1) printf("1 carry operation.\n"); 17 else printf("No carry operation.\n"); 18 } 19 return 0; 20 }
UVa10035 小学生算数(Primary Arithmetic)
标签:技术分享 png 算数 image scanf 技术 images += int
原文地址:http://www.cnblogs.com/seaupnice/p/7631422.html