【基础学习】C 读取并输出

尝试读取并输出两个数字和一个字符串:

#include 

int main() {
    int a;
    int b;

    char c[100];

    printf("please input two integer and one line string within 100 char.\n");

    scanf("%d %d %s", &a, &b, c);

    printf("%d %d %s\n", a, b, c);

    return 0;
}

然后运行:

➜  C ./a.out
please input two integer and one line string within 100 char.
123
23456
helloworld
123 23456 helloworld

你可能感兴趣的:(【基础学习】C 读取并输出)