C语言又一道小题目....

来源:百度知道 编辑:UC知道 时间:2024/06/06 19:03:38
This is a little warmup problem to check that your account is set up correctly, that we can receive your solutions correctly, and that we can judge your solutions and record the results correctly.

No lunch until everything is correct.

The input consists of a sequence of text lines, each terminated with a newline character. Your program should print the lines exactly as they appear in the input.

As with all questions, the input sequence is presented on the standard input stream (stdin); the output should be sent to the standard output stream (stdout).

Sample Input
967-1111
241-0-241
310-10-10
wa haha haha haha~~~~

Sample Output
967-1111
241-0-241
310-10-10
wa haha haha haha~~~~

这怎么数字和字符在一起的?输入的时候怎么定义呢?

楼长这个问题是不是要求输入之后输出相同的字符串?
如果是的话程序应该这么写
#include<stdio.h>
main()
{
int c;
c = getchar();
while(c != EOF)
{
putchar(c);
c = getchar();
}
}

之所以用int定义c是因为需要这个c足够大

用字符数组来接收输入啊