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 |
错得无语了~~~~~急救呀…………#include<stdio.h> #include<string.h> char num[15]; int main() { int i,len; int total[15]; for(i=0;i<15;i++) { total[i]=0; } memset(num,0,sizeof(num)); // scanf("%s",num); while(scanf(" %s",num)!=EOF) // while(gets(num)!=0) { // printf("fsdafasdf\n"); len=strlen(num); for(i=0;i<len;i++) { // printf("%c",total[i]); if((total[i]+(num[i]-'0'))>=10) { total[i]=total[i]+(num[i]-'0')-10; } else { total[i]=total[i]+(num[i]-'0'); } } memset(num,0,sizeof(num)); } // printf("fsdafasdf\n"); for(i=0;i<len;i++) { printf("%d",total[i]); } //getchar(); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator