Why?
查看原帖
Why?
752808
Super_Ken楼主2023/5/25 21:52

我测试了,是对的,为啥all WA?

#include<bits/stdc++.h>
using namespace std;
string s,c;
int main(){
	getline(cin,s);
	s+=" ";
	for(int i=0;i<s.length();i++){
		c="";
		while(s[i]!=' ') c+=s[i++];
		for(int j=c.length()-1;j>=0;j--){
			cout<<c[j];
		}
		cout<<endl;
	}
	return 0;
}

萌新求助大佬!

2023/5/25 21:52
加载中...