string func(string a){
string b = " ";
int c = 0;
for(int i = a.size()-1;i>0;i--){
if(a[i]!=' ')
b+a[i];
else
break;
}
a[c] =b[i];
c++
return a;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
string func(string a){
string b = " ";
int c = 0;
for(int i = a.size()-1;i>0;i--){
if(a[i]!=' ')
b+a[i];
else
break;
}
for(int i = a.size()-1;i>0;i--){
a[c] =b[i];
c++
}
return a;
}