#include <stdio.h> int main() { int ch = 0; int line = 1; int flag = 1; while ((ch = getchar()) != EOF) { if (flag) { printf("%d", line); line++; flag = 0; } if (ch == ‘\n‘) { flag = 1; } putchar(ch); } return 0; }
原文地址:http://10706198.blog.51cto.com/10696198/1758196