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

那位大哥哥,大姐姐 能帮我看看为什么WRONG ANSWER

Posted by ban at 2006-07-05 16:29:03 on Problem 1146
#include <iostream.h>

#include <string.h>



int main()

{

	char line[55];

	short i,j,len;



	while(1)

	{

		cin>>line;

		if(line[0]=='#')

			break;

		len=strlen(line);

		for(i=len-1;i && line[i-1]>=line[i];i--)

			;

		if(i==0)

		{

			cout<<"No Successor"<<endl;

			continue;

		}

		for(j=0;j<i-1;j++)

			cout<<line[j];

		cout<<line[len-1];

		for(j=i-1;j<len-1;j++)

			cout<<line[j];

		cout<<endl;

	}

	return 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