编写这个程序的时候一开始没有思路 后面参考了网上的一些方法 熟悉了getchar的使用方法
#include<stdio.h>
int main()
{
int ch;
int i = 1, j = 1;
printf("请输入:\n");
while ((ch = getchar()) != EOF)
{
if (j == 1)
{
printf("%d.", i);
i++;
j++;
}
if (ch == '\n')
j = 1;
putchar(ch);
}
system("pause");
return 0;
}