Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main(){
- int x,y,j,T;
- char t;
- char* str=new char;
- int* std=new int;
- cin>>str;
- y=strlen(str);
- for (x=0;x<y;x++){
- std[x]=(int)str[x];
- }
- for(x=0;x<y;x++){
- for(j=x;j<y;j++){
- if (std[x]<std[j]){
- T=std[x];
- std[x]=std[j];
- std[j]=T;
- }
- }
- }
- cout<<"work complete:\n";
- for(x=y-1;x>=0;x--){
- str[x]=(char)std[x];
- cout<<str[x];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement