单选题

下面程序的功能是从输入字符串中找出最长字符串,则下面程序哪行存在错误(&n...

发布于 2022-03-03 14:03:52

下面程序的功能是从输入字符串中找出最长字符串,则下面程序哪行存在错误()
#include "stdio.h"
#include "string.h"
#define N 10
int main()
{
    char s[N][81], * t                                     // line:1
    int j                                                  // line:2
    for (j=0 j<N j++)                                     // line:3
        gets (s[j])                                        // line:4
    t= *s                                                  // line:5
    for (j=1 j<N j++)                                     // line:6
        if (strlen(t)<strlen(s[j]))                         // line:7
            t=&s[j]                                        // line:8
    printf("strings is: %d, %s\n", strlen(t), t)           // line:9
}

登录后免费查看答案
关注者
0
被浏览
28