解题思路:
注意事项:
参考代码:
#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 人评分
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:1458 |
A+B for Input-Output Practice (VI) (C语言代码)浏览:552 |
1126题解浏览:584 |
矩形面积交 (C++代码)浏览:1127 |
简单的a+b (C语言代码)浏览:535 |
1052题解(链表操作)浏览:661 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:467 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:570 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:446 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:493 |