| ||||||||||
| 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 | |||||||||
这题我用getchar终于过了。。。测试数据黑的一Bmain(){
int a[2] = {};
int index = 0;
int bfirstNoneBlank = 0;
char c;
while((c=getchar())!=-1){
if(' '==c||'\t'==c)
index = bfirstNoneBlank;
else if('\n'==c){
if(bfirstNoneBlank){
printf("%d\n",a[0]+a[1]);
index = 0;
a[0] = 0;
a[1] = 0;
bfirstNoneBlank = 0;
}
}
else {
bfirstNoneBlank = 1;
a[index] *= 10;
a[index] += c - '0';
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator