文章

75

粉丝

66

获赞

75

访问

6.6k

头像
国名排序(C++) 题解:
P1217 同济大学机试题
发布于2024年4月29日 23:00
阅读数 83

#include <bits/stdc++.h>
using namespace std;

vector<string> res; 

int n;

int main()
{
	string s;
	
	while(cin >> n)
	{
		res.clear();
		for(int i = 0; i < n; i ++)
			cin >> s, res.push_back(s);
		
		sort(res.begin(), res.end());
		
		for(int i = 0; i < n; i ++)
			cout << res[i] << endl;
		
	}
	
	
	return 0;
} 

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发