aboutsummaryrefslogtreecommitdiff
path: root/4
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-30 17:55:19 +0100
committerAkshay <[email protected]>2021-04-30 17:55:19 +0100
commitda1764a9f839e1d29b2bee12d35534f71f05c6ff (patch)
treed410c2191e571f9e6945ed88afd3faa1175675b3 /4
parent9ff0cec8b507d9164d8828dcb2a87012e140fdf5 (diff)
law & order
Diffstat (limited to '4')
-rw-r--r--4/input9
-rw-r--r--4/main.l32
2 files changed, 0 insertions, 41 deletions
diff --git a/4/input b/4/input
deleted file mode 100644
index d1dff11..0000000
--- a/4/input
+++ /dev/null
@@ -1,9 +0,0 @@
1int main() {
2 int n;
3 printf("hello world");
4 scanf("%d", &n);
5 printf("hello world");
6 printf("hello world");
7 printf("hello world");
8 printf("hello world");
9}
diff --git a/4/main.l b/4/main.l
deleted file mode 100644
index 28593f6..0000000
--- a/4/main.l
+++ /dev/null
@@ -1,32 +0,0 @@
1%{
2
3int scans = 0;
4int prints = 0;
5%}
6
7%%
8scanf {
9 scans++;
10 fprintf(yyout, "readf");
11};
12printf {
13 prints++;
14 fprintf(yyout, "writef");
15}
16. fprintf(yyout, "%s", yytext);
17\n fprintf(yyout, "\n");
18%%
19
20int main(void) {
21 yyin=fopen("4/input", "r+");
22 yyout=fopen("4/output", "w");
23 yylex();
24 printf("%d printf occurrence(s)\n", prints);
25 printf("%d scanf occurrence(s)\n", scans);
26}
27
28int yywrap()
29{
30 return(1);
31}
32