0分蒟蒻求助
查看原帖
0分蒟蒻求助
992935
prophetcoding楼主2023/8/12 10:05
#include <bits/stdc++.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
vector<string> a;
bool cmp(string x,string y)
{
	return x.size()>y.size();
}
int main()
{
	int i=1;
	string word;
	while(cin>>word &&cin.get()!='\n'){
		++i;
		a.push_back(word);
	}
	sort(a.begin(),a.end(),cmp);
	cout<<a.front()<<'\n'<<a[i-2]<<endl;
	return 0;
}
2023/8/12 10:05
加载中...