版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
代码
#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]#