|
|
вернуться в форумwhat's wrong Послано dheman 26 фев 2010 02:16 my code is #include<stdio.h> #include<string.h> int main() { char a[10]; while(scanf("%s",a)==1) { long int s1=0,s2=0; long int len = strlen(a); for(long int i=0;i<len;i++) { if(i<3) s1 = s1 + (a[i]-'0'); else s2 = s2 + (a[i] - '0'); } long int sub = s1 - s2;
if(sub ==1 || sub== -1) { if(sub==1) { long int add = (a[len-1]-'0')+1; if(add>9) { printf("No\n"); } else printf("Yes\n"); } else if(sub == -1) { if(a[len-1]<1) printf("No\n"); else printf("Yes\n"); } } else printf("No\n"); } return 0; } i don't know where is my problem. please help me. Re: what's wrong opps. sorry .. i found my mistake.. |
|
|