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 |
AC了,可是我不知道如何解释他呀~~~~摆脱大牛冒个泡#include<stdio.h> #include<string.h> #include<stdlib.h> char num[15]; char total[15]; int main() { int i,len,temp; memset(total,0,sizeof(total)); memset(num,0,sizeof(num)); gets(total); //如果没有这句话就WA~~~~可是我觉得没有什么区别呀? while(gets(num)!=0) { len=strlen(num); for(i=0;i<len;i++) { total[i]=(total[i]+num[i]-'0'-'0')%10+'0'; } memset(num,0,sizeof(num)); } printf("%s",total); //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