%{
#include<stdio.h>
int pc=0, sc=0;
%}
%%
“printf” { fprintf(yyout,”writef”); pc++;}
“scanf” { fprintf(yyout,”readf”); sc++;}
%%
int yywrap()
{
return 1;
}
main()
{
yyin=fopen(“input.txt”,”r”);
yyout=fopen(“output.txt,”w”);
yylex();
printf(“No of printf statements = %d\n No of scanf statements=%d\n”, pc, sc);
}
JXsKI2luY2x1ZGU8c3RkaW8uaD4KaW50IHBjPTAsIHNjPTA7CiV9CiUlCuKAnHByaW50ZuKAnSB7IGZwcmludGYoeXlvdXQs4oCdd3JpdGVm4oCdKTsgcGMrKzt9CuKAnHNjYW5m4oCdIHsgZnByaW50Zih5eW91dCzigJ1yZWFkZuKAnSk7IHNjKys7fQolJQppbnQgeXl3cmFwKCkKewpyZXR1cm4gMTsKfQptYWluKCkKewp5eWluPWZvcGVuKOKAnGlucHV0LnR4dOKAnSzigJ1y4oCdKTsKeXlvdXQ9Zm9wZW4o4oCcb3V0cHV0LnR4dCzigJ134oCdKTsKeXlsZXgoKTsKcHJpbnRmKOKAnE5vIG9mIHByaW50ZiBzdGF0ZW1lbnRzID0gJWRcbiBObyBvZiBzY2FuZiBzdGF0ZW1lbnRzPSVkXG7igJ0sIHBjLCBzYyk7Cn0=