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 |
怎么会running error啊#include<stdio.h> #include<string.h> int main() { int a[4],b[4]; char str[6]; memset(b,0,sizeof(b)); while(scanf("%s",str)!=EOF) { int length=strlen(str); for(int i=0;i<length;++i) a[i]=str[i]-'0'; for(int i=0;i<4;++i) { b[i]+=a[i]; if(b[i]>=10) b[i]-=10; } } for(int i=0;i<4;++i) { printf("%d",b[i]); } printf("\n"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator