Competitive C/C++ Programming for Beginners
Pages
Home
Algorithms
Books
Thursday, September 26, 2013
Permutation of a given String.
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string s;
cin>>s;
cout<<"\n Permutations Are\n";
do
{
cout<<s<<"\n";
}while(next_permutation(s.begin(),s.end()));
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment