Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstring>
- #include <algorithm>
- #include <iostream>
- #include <fstream>
- char phrase[201];
- int main()
- {
- scanf("%s",phrase);
- int n = 0;
- for(int i=0; i<=strlen(phrase); i++)
- {
- for(n; n<=strlen(phrase); n++)
- {
- if (phrase[n] <= phrase[n+1])
- {
- char temp,temp2;
- temp = phrase[n];
- temp2=phrase[n+1];
- phrase[n]= temp2;
- phrase[n+1]=temp;
- goto main;
- break;
- }
- }
- }
- main:
- std::cout << phrase;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement