%{
#include <stdio.h>
int lc=0,sc=0,wc=0,ch=0;
%}
%%
[\n]{lc++;ch+=yyleng;}
[\t]{sc++;ch+=yyleng;}
[^\t\n]{wc++;ch+=yyleng;}
%%
int yywrap(){};
int main()
{
printf("give any sentence");
yylex();
printf("no of lines :%d\n",lc);
printf("no of lines :%d\n",wc);
printf("no of lines :%d\n",sc);
printf("no of lines :%d\n",ch);
yylex();
return 0;
}
JXsKICAjaW5jbHVkZSA8c3RkaW8uaD4KICBpbnQgbGM9MCxzYz0wLHdjPTAsY2g9MDsKJX0KJSUKW1xuXXtsYysrO2NoKz15eWxlbmc7fQpbXHRde3NjKys7Y2grPXl5bGVuZzt9ClteXHRcbl17d2MrKztjaCs9eXlsZW5nO30KJSUKaW50IHl5d3JhcCgpe307CmludCBtYWluKCkKewogIHByaW50ZigiZ2l2ZSBhbnkgc2VudGVuY2UiKTsKICB5eWxleCgpOwogIHByaW50Zigibm8gb2YgbGluZXMgOiVkXG4iLGxjKTsKICBwcmludGYoIm5vIG9mIGxpbmVzIDolZFxuIix3Yyk7CiAgcHJpbnRmKCJubyBvZiBsaW5lcyA6JWRcbiIsc2MpOwogIHByaW50Zigibm8gb2YgbGluZXMgOiVkXG4iLGNoKTsKICB5eWxleCgpOwogIHJldHVybiAwOwp9Cg==