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 |
wa的同学注意了,这题数据有问题,后面有可能有多的空行……#include <stdio.h> #include <math.h> #include <algorithm> #include <map> #include <string> #include <string.h> #include <queue> #include <set> using namespace std; int a[10],l; char c; int main() { while((c=getchar())&&c!='\n') a[l++]=c-'0'; while((c=getchar())&&c!=-1&&c!='\n') //while((c=getchar())!=-1) { a[0]+=c-'0'; for(int i=1;i<l;i++) { c=getchar(); a[i]+=c-'0'; } getchar(); } for(int i=0;i<l;i++) printf("%d",a[i]%10); putchar('\n'); } 换成注释就WA到ORZ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator