样例过了全WA……
查看原帖
样例过了全WA……
749831
Luogu_are_DASB楼主2023/8/25 11:34
#include <iostream>
#include <string>
using namespace std;
/*
Happy.Sun
*/
string s;
int pos=1;
int main(){
	getline(cin,s);
	s=' '+s+' ';
	for(int i=1;i<s.size();i++){
		if(s[i]==' ') {
			for(int j=i-1;j>=pos;j--){
				cout<<s[j];
			}
			cout<<endl;
			pos=i+1;
		}
	}
	return 0;
}

2023/8/25 11:34
加载中...