参考
#include
#include
int main()
{
char str[5][256], longest[256], largest[256];
int i;
for (i = 0; i < 5; ++i){
gets(str[i]);
}
strcpy(longest, str[0]);
strcpy(largest, str[0]);
for (i = 1; i < 5; ++i){
if (strcmp(largest, str[i]) < 0){
strcpy(largest, str[i]);
}
if (strlen(longest) < strlen(str[i])){
strcpy(longest, str[i]);
}
}
puts(longest);
puts(largest);
return 0;
}