aboutsummaryrefslogtreecommitdiff
path: root/4
diff options
context:
space:
mode:
Diffstat (limited to '4')
-rw-r--r--4/input4
-rw-r--r--4/main.l7
2 files changed, 7 insertions, 4 deletions
diff --git a/4/input b/4/input
index 7f0cc0b..d1dff11 100644
--- a/4/input
+++ b/4/input
@@ -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}
diff --git a/4/main.l b/4/main.l
index f768382..28593f6 100644
--- a/4/main.l
+++ b/4/main.l
@@ -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
28int yywrap() 28int yywrap()
29{ 29{
30exit(0);
31 return(1); 30 return(1);
32} 31}
33 32