%{
#include<stdio.h>
int lc=0,sc=0,tc=0,ch=0,wc=0;
%}
%%
[\n] { lc++; ch+=yyleng;}
[ \t] { sc++; ch+=yyleng;}
[^\t] { tc++; ch+=yyleng;}
[^\t\n ]+ { wc++; ch+=yyleng;}
%%
int yywrap(){ return 1; }
int main(){
printf("Enter the Sentence : ");
yylex();
printf
("
Number of lines
: %d\n",lc); printf
("
Number of spaces
: %d\n",sc); printf
("
Number of tabs
, words
, charc
: %d , %d , %d\n",tc,wc,ch);
return 0;
}
ICV7CiNpbmNsdWRlPHN0ZGlvLmg+CmludCBsYz0wLHNjPTAsdGM9MCxjaD0wLHdjPTA7CSAKJX0KCiAKJSUKW1xuXSB7IGxjKys7IGNoKz15eWxlbmc7fQpbIFx0XSB7IHNjKys7IGNoKz15eWxlbmc7fQpbXlx0XSB7IHRjKys7IGNoKz15eWxlbmc7fQpbXlx0XG4gXSsgeyB3YysrOyBjaCs9eXlsZW5nO30gCiUlCgppbnQgeXl3cmFwKCl7IHJldHVybiAxOyB9ICAgCmludCBtYWluKCl7CglwcmludGYoIkVudGVyIHRoZSBTZW50ZW5jZSA6ICIpOwoJeXlsZXgoKTsKCXByaW50ZigiTnVtYmVyIG9mIGxpbmVzIDogJWRcbiIsbGMpOwoJcHJpbnRmKCJOdW1iZXIgb2Ygc3BhY2VzIDogJWRcbiIsc2MpOwoJcHJpbnRmKCJOdW1iZXIgb2YgdGFicywgd29yZHMsIGNoYXJjIDogJWQgLCAlZCAsICVkXG4iLHRjLHdjLGNoKTsKCQoJcmV0dXJuIDA7Cn0K