Advertisement
theelitenoob

Anagram Finder

Sep 9th, 2012
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char *argv[]){
  8.     string input;
  9.     // get input
  10.     cout << "Please enter a word: ";
  11.     cin >> input;
  12.     cout << endl;
  13.     sort(input.begin(), input.end());
  14.     do
  15.         cout << input << endl;
  16.     while(next_permutation(input.begin(), input.end()));
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement