Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

被输入搞得一直RE。。。

Posted by Nstd at 2010-11-18 16:18:10 on Problem 1270
看了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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator