0
点赞
收藏
分享

微信扫一扫

算法训练营 训练 1- 43(C语言实现)

高子歌 2022-01-24 阅读 35

定义被一些字符串,求长度并运算、输出。

#include <stdio.h>
#include <string.h>

int main(void) {
    char s1[100];
    char s2[20] = "hello!";
    scanf("%s",&s1);
    printf("%d\n",strlen(s1));
    printf("%s\n",s2);
    printf("%d\n",strlen(s2));
    return 0;
}

输入:

app

输出:

3
hello!
6
举报

相关推荐

0 条评论