哪里输出格式错了
查看原帖
哪里输出格式错了
257173
rish楼主2024/3/2 22:06

"Your program successfully solved the problem, but the output is not correctly formatted. Please check the output format specification and submit again."啥意思

#include <bits/stdc++.h>
using namespace std;
int main()
{
	set<string> a;
	string x;
	while(cin >> x)
	{
		string s;
		for(int i=0;i<x.size();i++)
		{
			if(x[i]>='A'&&x[i]<='Z') s = s+char(x[i]-('A'-'a'));
			else if(x[i]>='a'&&x[i]<='z') s+=x[i];
			else if(s!="") 
			{
				a.insert(s);s="";continue;
			}
		}
		a.insert(s);
	}
	for(auto it = a.begin();it!=a.end();it++)
	{
		cout << *it << endl;
	}
	return 0;
}
2024/3/2 22:06
加载中...