标签:c语言:标准输入读取几行输入。每行输入都要打印到标准输出上 前面加上行号。行号不能有限制
#include<stdio.h>
#include<stdlib.h>
int main()
{
char str;
int count=1;
int start=1;
while(1)
{
printf("input your line\n");
do
{
scanf("%c",&str);
if(start==1)
{
printf("%d.",count);
start=0;
}
printf("%c",str);
}while(str!=‘\n‘);
start=1;
count++;
}C语言:标准输入读取几行输入。每行输入都要打印到标准输出上,前面加上行号。行号不能有限制
标签:c语言:标准输入读取几行输入。每行输入都要打印到标准输出上 前面加上行号。行号不能有限制
原文地址:http://10740184.blog.51cto.com/10730184/1702483