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

判断连续两个__时注意一下~

Posted by ding59 at 2009-02-06 23:37:18 on Problem 3157
建议for(i=1;i<n;i++)
{
   if(a[i]=='_'&&a[i-1]=='_')
    ...
}
不要用
for(i=0;i+1<n;i++)
{
  if(a[i]=='_'&&a[i+1]=='_')
  ...
}
因为i+1<n很可能影响到for语句里面的其他if语句,i只能取到n-2;
就因为这个我wa了n次,惭愧啊!

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