本题学习erase函数的用法
#include <iostream>
#include <cstring>
using namespace std;
string str[550];
int main(void)
{
int cnt = 0;
int max_cnt = 0;
int idx = 0;
while (cin >> str[cnt]) cnt++;
str[cnt-1].erase(str[cnt-1].size() - 1);
for (int i = 0; i < cnt; i++) {
if (str[i].size() > max_cnt) {
max_cnt = str[i].size();
idx = i;
}
}
cout << str[idx] << endl;
return 0;
}