这一题不会,求教
  • 板块学术版
  • 楼主xiaoxiaoxia
  • 当前回复19
  • 已保存回复20
  • 发布时间2025/1/4 17:50
  • 上次更新2025/1/4 21:41:48
查看原帖
这一题不会,求教
677127
xiaoxiaoxia楼主2025/1/4 17:50

这题的单词是一组一行,我一直无法换行,求教。

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int T;
	cin>>T;
	while(T--)
	{
		string s;
		while(cin>>s)
		{
			reverse(s.begin(),s.end());
			cout<<s<<" ";
		}
	}
	return 0;
}
2025/1/4 17:50
加载中...