文章

43

粉丝

180

获赞

21

访问

180.5k

头像
c++
P1798 华南理工大学/西北工业大学2019机试
发布于2022年4月30日 13:49
阅读数 5.2k

#include <iostream>
#include <algorithm>

using namespace std;

int x, cnt;
vector<int> s;

int main()
{
	
	char a;
	while (cin >> x) 
	{
		s.push_back(x);
		cin >> a;
	}
	sort(s.begin(), s.end());
	for (auto& x : s)
	{
		cout << x;
		if (++ cnt % 4) cout << ' ';
		else cout << endl;
	}
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发