home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 79 / IOPROG_79.ISO / soft / Codice / Lez22.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2004-02-26  |  541 b   |  28 lines

  1. // Lez22.cpp
  2.  
  3. #include <algorithm>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     char prev[] = "ciao"; //si provi a inserire una parola diversa qui...
  11.     cout << "Le permutazioni precedenti " << prev << " sono:\n";
  12.     while (prev_permutation(prev,prev+sizeof(prev)-1))
  13.         cout << prev << "\t";
  14.  
  15.     char next[] = "ciao"; //... e qui
  16.     cout << "\n\nLe permutazioni successive a " << next << " sono:\n";
  17.     while (next_permutation(next,next+sizeof(next)-1))
  18.         cout << next << "\t";
  19.  
  20.     cout << endl;
  21.  
  22.     return 0;
  23. }
  24.  
  25.  
  26.  
  27.  
  28.