diff options
Diffstat (limited to '4')
-rw-r--r-- | 4/input | 4 | ||||
-rw-r--r-- | 4/main.l | 7 |
2 files changed, 7 insertions, 4 deletions
@@ -2,4 +2,8 @@ int main() { | |||
2 | int n; | 2 | int n; |
3 | printf("hello world"); | 3 | printf("hello world"); |
4 | scanf("%d", &n); | 4 | scanf("%d", &n); |
5 | printf("hello world"); | ||
6 | printf("hello world"); | ||
7 | printf("hello world"); | ||
8 | printf("hello world"); | ||
5 | } | 9 | } |
@@ -13,7 +13,7 @@ printf { | |||
13 | prints++; | 13 | prints++; |
14 | fprintf(yyout, "writef"); | 14 | fprintf(yyout, "writef"); |
15 | } | 15 | } |
16 | ; fprintf(yyout, "%s", yytext); | 16 | . fprintf(yyout, "%s", yytext); |
17 | \n fprintf(yyout, "\n"); | 17 | \n fprintf(yyout, "\n"); |
18 | %% | 18 | %% |
19 | 19 | ||
@@ -21,13 +21,12 @@ int main(void) { | |||
21 | yyin=fopen("4/input", "r+"); | 21 | yyin=fopen("4/input", "r+"); |
22 | yyout=fopen("4/output", "w"); | 22 | yyout=fopen("4/output", "w"); |
23 | yylex(); | 23 | yylex(); |
24 | printf("%d printf occurrences\n", prints); | 24 | printf("%d printf occurrence(s)\n", prints); |
25 | printf("%d scanf occurrences\n", scans); | 25 | printf("%d scanf occurrence(s)\n", scans); |
26 | } | 26 | } |
27 | 27 | ||
28 | int yywrap() | 28 | int yywrap() |
29 | { | 29 | { |
30 | exit(0); | ||
31 | return(1); | 30 | return(1); |
32 | } | 31 | } |
33 | 32 | ||