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 |
被输入搞得一直RE。。。看了Discuss考虑了空格的问题,用getchar()做的读入第二行: fg=0; while((t2=getchar())!='\n'){ if(t2!=' ') if(!fg){ t1=t2; fg=1;} else { bod[t1-'a'][++bod[t1-'a'][0]]=t2-'a'; fg=0; } } 一直RE... 以为是数组开小了,后来去改数组大小,结果总共贡献了6个RE... 最后改成gets()就过了: gets(tp); for(fg=0,i=0;tp[i];i++) if(tp[i]!=' ') if(!fg){ t1=tp[i]; fg=1;} else{ bod[t1-'a'][++bod[t1-'a'][0]]=tp[i]-'a'; fg=0; } 这悲剧又恶心的输入 -_-||| Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator