解题思路:
注意事项:
参考代码:
#include <iostream> using namespace std; int main() { string str="",max=""; while(1){ cin>>str;//输入 int len=str.length(); if(len>max.length()){//更新最长数组 max=str; } if(cin.get()=='\n') break;//跳出死循环条件 } cout<<max<<endl;//输出 return 0; }
0.0分
1 人评分