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

使用C++STL中的next_permutation()可以大大简化此题的难度

Posted by jourkliu at 2009-03-09 01:07:40 on Problem 1146 and last updated at 2009-03-09 01:08:05
程序仅供参考:
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
	string s;
	while(cin>>s&&s!="#"){
		if(next_permutation(s.begin(),s.end())) cout<<s<<endl;
		else cout<<"No Successor"<<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