%{
#include <stdio.h>
int wc=0, cc=0, lc=0, sc=0, tc=0
%}
%%
[\n] { lc++; cc+=yyleng;}
[ \t] { sc++; cc+=yyleng;}
[^\t] { tc++; cc+=yyleng;}
[^\t\n] { wc++; cc+=yyleng;}
%%
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);}
JXsKICAjaW5jbHVkZSA8c3RkaW8uaD4KICBpbnQgd2M9MCwgY2M9MCwgbGM9MCwgc2M9MCwgdGM9MAolfQoKJSUKW1xuXSB7IGxjKys7IGNjKz15eWxlbmc7fQpbIFx0XSB7IHNjKys7IGNjKz15eWxlbmc7fQpbXlx0XSB7IHRjKys7IGNjKz15eWxlbmc7fQpbXlx0XG5dIHsgd2MrKzsgY2MrPXl5bGVuZzt9CiUlCgp5eXdyYXAoKXsgcmV0dXJuIDE7IH0KCmludCBtYWluKCl7CiAgcHJpbnRmKCJFbnRlciB0aGUgU2VudGVuY2UgOiAiKTsKICB5eWxleCgpOwogIHByaW50ZigiTnVtYmVyIG9mIGxpbmVzIDogJWRcbiIsbGMpOwoJcHJpbnRmKCJOdW1iZXIgb2Ygc3BhY2VzIDogJWRcbiIsc2MpOwoJcHJpbnRmKCJOdW1iZXIgb2YgdGFicywgd29yZHMsIGNoYXJjIDogJWQgLCAlZCAsICVkXG4iLHRjLHdjLGNoKTsKfQ==