读标准输入,写标准输出

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/ming2453755227/article/details/102742265

代码

#include <stdio.h>

int main(){
        char s[80];
        fputs(fgets(s, 80, stdin), stdout);
        return 0;
}

输出

[root@localhost test]# ls
demo  main.cpp
[root@localhost test]# ./demo 
this is a test
this is a test
[root@localhost test]# 

猜你喜欢

转载自blog.csdn.net/ming2453755227/article/details/102742265
今日推荐