#include<stdio.h> #include<string.h> int main(){ int a[5],i,max; char str[5][100]; for(i=0;i<5;i++){ scanf("%s",str[i]); a[i] = strlen(str[i]); } for(i=0;i<5;i++){ if(a[i] > a[max]){ max = i; } } printf("%s",str[max]); return 0; }
原文:https://www.cnblogs.com/Hqx-curiosity/p/12236683.html