%{
#include<stdio.h>
int sc=0,wc=0,lc=0,cc=0;
%}
%%
[\n] { lc++; wc++;}
[\t] { sc++; wc++;}
[" "] { sc++; wc++;}
[^\n\t ]+ {cc+=yyleng;}
%%
void 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 are
=%d\n",cc);}
int yywrap( )
{
return 1;
}
JXsKI2luY2x1ZGU8c3RkaW8uaD4KaW50IHNjPTAsd2M9MCxsYz0wLGNjPTA7CiV9CiUlCltcbl0geyBsYysrOyB3YysrO30KW1x0XSB7IHNjKys7IHdjKys7fQpbIiAiXSB7IHNjKys7IHdjKys7fQpbXlxuXHQgXSsge2NjKz15eWxlbmc7fQolJQp2b2lkIG1haW4oKQp7CnByaW50ZigiRW50ZXIgdGhlIGlucHV0OlxuIik7Cnl5bGV4KCk7CnByaW50ZigiVGhlIG51bWJlciBvZiBsaW5lcz0lZFxuIixsYyk7CnByaW50ZigiVGhlIG51bWJlciBvZiBzcGFjZXM9JWRcbiIsc2MpOwpwcmludGYoIlRoZSBudW1iZXIgb2Ygd29yZHM9JWRcbiIsd2MpOwpwcmludGYoIlRoZSBudW1iZXIgb2YgY2hhcmFjdGVycyBhcmU9JWRcbiIsY2MpOwp9CmludCB5eXdyYXAoICkKewpyZXR1cm4gMTsKfQ==