Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #include<conio.h>
  2. #include<vector>
  3. #include<string>
  4. #include<fstream>
  5. #include<iostream>
  6. #include<istream>
  7. #include <limits>
  8. #include<algorithm>
  9. #include<cctype>
  10. using namespace std;
  11. int main() {
  12. const int INF = 1e9 + 7;
  13. //std::ios::sync_with_stdio(false);
  14. freopen("bwt.in", "r", stdin);
  15. freopen("bwt.out", "w", stdout);
  16. //cin.ignore(numeric_limits<streamsize>::max(), '\n');
  17. string s;
  18. //string spisok = "abcdefghijklmnopqrstuvwxyz";
  19. cin >> s;
  20. vector<char> mas;
  21. vector<char> str;
  22. vector<string> strokitut;
  23.  
  24. for (int i = 0; i < s.size(); i++) {
  25. strokitut.push_back(s);
  26. rotate(s.begin(), s.begin()+1, s.end());
  27.  
  28. }
  29. sort(strokitut.begin(), strokitut.end());
  30. for (int i = 0; i < strokitut.size(); i++) {
  31. cout << strokitut[i].back();
  32. }
  33.  
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement