fork download
  1. #include<bits/stdc++.h>
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9. string x,s ,mx=x;
  10. cin>>x;
  11.  
  12. long long v=x.size() ;
  13. for (long long i=1 ;i<=v ;i++)
  14. {
  15. s=x;
  16. x="";
  17. for (long long j=1 ;j<v ;j++)
  18. x+=s[j] ;
  19. x+=s[0] ;
  20. if (x>mx)mx=x;
  21. }
  22. cout << mx << endl ;
  23. return 0;
  24. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout