解题思路:
注意事项:
参考代码:
#include <deque>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <iterator>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <string>
#include <cmath>
#include <string.h>
using namespace std;
void splitstring(string str,char ch,deque<string>& q)
{
stringstream ss(str);
string s;
while(getline(ss,s,ch))
{
q.push_back(s);
}
}
int main()
{
string str;
getline(cin,str);
deque<string> q;
splitstring(str,' ',q);
deque<int> p;
for(int i=0;i<q.size();i++)
{
p.push_back(q[i].size());
}
int x=max_element(p.begin(),p.end())-p.begin();
cout<<q[x]<<endl;
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:552 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:551 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:600 |
A+B for Input-Output Practice (III) (C语言代码)浏览:576 |
【简单计算】 (C语言代码)浏览:622 |
WU-C语言程序设计教程(第三版)课后习题12.1 (C++代码)浏览:939 |
1011题解浏览:765 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:557 |
简单的a+b (C语言代码)浏览:419 |
Tom数 (C语言代码)浏览:527 |