%{
#include <stdio.h>
int sc = 0, wc = 0, lc = 0, cc = 0;
%}
%%
\n { lc++; }
[ \t] { sc++; }
[^\n \t]+ { wc++; cc += yyleng; }
%%
int main() {
printf("Enter the input:\n");
yylex();
printf
("The
number of lines
= %d\n", lc); printf
("The
number of spaces
= %d\n", sc); printf
("The
number of words
= %d\n", wc); printf
("The
number of characters
= %d\n", cc); return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CmludCBzYyA9IDAsIHdjID0gMCwgbGMgPSAwLCBjYyA9IDA7CiV9CgolJQoKXG4gICAgICAgICAgeyBsYysrOyB9ClsgXHRdICAgICAgIHsgc2MrKzsgfQpbXlxuIFx0XSsgICB7IHdjKys7IGNjICs9IHl5bGVuZzsgfQoKJSUKCmludCBtYWluKCkgewogICAgcHJpbnRmKCJFbnRlciB0aGUgaW5wdXQ6XG4iKTsKICAgIHl5bGV4KCk7CiAgICBwcmludGYoIlRoZSBudW1iZXIgb2YgbGluZXMgPSAlZFxuIiwgbGMpOwogICAgcHJpbnRmKCJUaGUgbnVtYmVyIG9mIHNwYWNlcyA9ICVkXG4iLCBzYyk7CiAgICBwcmludGYoIlRoZSBudW1iZXIgb2Ygd29yZHMgPSAlZFxuIiwgd2MpOwogICAgcHJpbnRmKCJUaGUgbnVtYmVyIG9mIGNoYXJhY3RlcnMgPSAlZFxuIiwgY2MpOwogICAgcmV0dXJuIDA7Cn0KCmludCB5eXdyYXAoKSB7CiAgICByZXR1cm4gMTsKfQ==