Johnny Chen | 49cb85d | 2011-11-28 21:39:07 +0000 | [diff] [blame] | 1 | #include <stdio.h> |
2 | |||||
3 | int main(int argc, char const *argv[]) { | ||||
4 | printf("Hello world.\n"); | ||||
5 | char line[100]; | ||||
6 | int count = 1; | ||||
7 | while (fgets(line, sizeof(line), stdin)) { // Reading from stdin... | ||||
8 | fprintf(stderr, "input line=>%d\n", count++); | ||||
Johnny Chen | 5886fb5 | 2012-01-12 00:29:46 +0000 | [diff] [blame] | 9 | if (count > 3) |
10 | break; | ||||
Johnny Chen | 49cb85d | 2011-11-28 21:39:07 +0000 | [diff] [blame] | 11 | } |
12 | |||||
13 | printf("Exiting now\n"); | ||||
14 | } |