Advertisement
Guest User

3.5

a guest
Nov 12th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. int main(){
  5. int x,y,j,T;
  6. char t;
  7. char* str=new char;
  8. int* std=new int;
  9. cin>>str;
  10. y=strlen(str);
  11.  
  12. for (x=0;x<y;x++){
  13. std[x]=(int)str[x];
  14. }
  15. for(x=0;x<y;x++){
  16. for(j=x;j<y;j++){
  17. if (std[x]<std[j]){
  18. T=std[x];
  19. std[x]=std[j];
  20. std[j]=T;
  21. }
  22. }
  23. }
  24. cout<<"work complete:\n";
  25. for(x=y-1;x>=0;x--){
  26. str[x]=(char)std[x];
  27. cout<<str[x];
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement