A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© pojian 中级黑马   /  2016-3-10 14:11  /  985 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

下面程序的功能是从输入的十个字符串中找出最长的那个串。请在________处填空。
#include "stdio.h"
#include "string.h"
#define N 10
main()
{
    char s[N][81], * t;
    int j;
    for (j=0; j<N; j++)
    {
        gets (s[j]);
    }
    t= *s;
    for (j=1; j<N; j++)
    {
        if (strlen(t)<strlen(s[j]))
        {
            ________;
        }
        printf("the max length of ten strings is: %d, %s\n", strlen(t), t);
    }
}
A. t=s[j]       B. t=&s[j]         C. t= s++          D. t=s[j][0]

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马