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 colours at 2009-04-18 15:52:07 on Problem 1146
In Reply To:使用C++STL中的next_permutation()可以大大简化此题的难度 Posted by:jourkliu at 2009-03-09 01:07:40
> 程序仅供参考:
> #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;
> }

能解释一下什么意思么?

next_permutation(s.begin(),s.end())

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