#include <stdio.h>
#define MAX_LEN 1001
int main(void)
{
char input[MAX_LEN];
int len;
char longest[MAX_LEN];
int longest_len = -1;
while(gets(input) != NULL && *input != '\0')
{
if((len = strlen(input)) > longest_len)
{
longest_len = len;
strcpy(longest, input);
}
}
if(longest_len >= 0)
puts(longest);
return 0;
}
C和指针 练习 1-4
最新推荐文章于 2022-11-24 13:33:29 发布