Run ID:26874
提交时间:2022-05-24 17:19:38
#include<iostream> #include<cmath> #include<cstdio> #include<cstring> using namespace std; int main() //主函数入口 { char str[200] = {0}; int i=0,index,max = 0,num=0; cin.getline(str,200); while(str[i]!='\0') { if(str[i]==' ') { if(num>max) { max = num; index = i; } num = 0; } else num++; i++; } if(num>max) { max = num; index = i; } index = index-max; for(i=0;i<max;i++) cout<<str[index+i]; cout<<endl; return 0; //结束整个程序 }