Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- using namespace std;
- void get( string str, string res ) {
- cout << res << endl;
- for( int i = 0; i < str.length(); i++ )
- get( string(str).erase(i,1), res + str[i] );
- }
- int main( int argc, char **argv) {
- string str = "abcde";
- get( str, "" );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement