Created
January 26, 2017 04:27
-
-
Save devteampentagon/dd769a0c7d0a69d109f3f80763c158cd to your computer and use it in GitHub Desktop.
Permutations of a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define MEM(a,b) memset((a),(b),sizeof(a)) | |
#define MAX(a,b) ((a)>(b)?(a):(b)) | |
#define MIN(a,b) ((a)<(b)?(a):(b)) | |
#define MIN3(a,b,c) MIN(MIN(a,b),c) | |
#define MIN4(a,b,c,d) MIN(MIN(MIN(a,b),c),d) | |
#define In freopen("In.txt", "r", stdin); | |
#define Out freopen("out.txt", "w", stdout); | |
#define i64 long long | |
#define u64 long long unsigned | |
#define INF (1<<28) | |
using namespace std; | |
int main() | |
{ | |
string str; | |
cin >> str; | |
do | |
{ | |
cout << str << endl; | |
}while(next_permutation(str.begin(),str.end())); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment