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:使用C++STL中的next_permutation()可以大大简化此题的难度

Posted by zihuacs at 2010-08-18 17:28:06 on Problem 1146
In Reply To:Re:使用C++STL中的next_permutation()可以大大简化此题的难度 Posted by:qianguangpan at 2010-05-01 15:50:50
my_code:
#include <iostream>
#include <algorithm>
using namespace std;
char str[51];
int main(void)
{
	while(scanf("%s",str))
	{
		if(str[0]=='#')
			break;
		if(next_permutation(str,str+strlen(str)))
		{
			printf("%s\n",str);
		}
		else
		{
			printf("No Successor\n");
		}
	}
	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