标记输出行

来源:互联网 发布:java hmacsha256 编辑:程序博客网 时间:2024/06/12 13:08
#include <stdio.h>int main(){int ch,i=0,j=1;while((ch=getchar()) != EOF)  //输入字符{if( j == 1 ){i++;printf("%d",i);  //输出行数j=j+1;}if( ch == '\n' ){j=1;}putchar(ch);             //输出字符}return 0;}

0 0