#include<iostream>
using namespace std;
int main(){
char str[255];
cin.get(str,255);
cin.get();
//cout<<revert(str)<<endl;
int len = strlen(str);
int end = len-1;
int start = end;
for(int i = len-1;i>=0;i--){
if(str[i]==' '){
start = i+1;
while(start<=end){
cout<<str[start];
start++;
}
cout<<" ";
end = i-1;
}
if(i==0){
start =0;
while(start<=end){
cout<<str[start];
start++;
}
}
}
system("pause");
return 0;
}
单词倒序输出2
最新推荐文章于 2022-12-29 20:22:22 发布