%{
#include <stdio.h>
%}
%%
[0-9]+ {
int num = atoi(yytext);
if (num % 2 == 0)
printf("%s is Even\n", yytext);
else
printf("%s is Odd\n", yytext);
}
\n { /* Ignore newlines */ }
. { /* Ignore other characters */ }
%%
int main() {
printf("Enter numbers (Ctrl+D to stop):\n");
yylex();
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQpbMC05XSsgeyAKICAgIGludCBudW0gPSBhdG9pKHl5dGV4dCk7IAogICAgaWYgKG51bSAlIDIgPT0gMCkgCiAgICAgICAgcHJpbnRmKCIlcyBpcyBFdmVuXG4iLCB5eXRleHQpOyAKICAgIGVsc2UgCiAgICAgICAgcHJpbnRmKCIlcyBpcyBPZGRcbiIsIHl5dGV4dCk7IAp9ClxuICAgICAgeyAvKiBJZ25vcmUgbmV3bGluZXMgKi8gfQouICAgICAgIHsgLyogSWdub3JlIG90aGVyIGNoYXJhY3RlcnMgKi8gfQolJQoKaW50IG1haW4oKSB7CiAgICBwcmludGYoIkVudGVyIG51bWJlcnMgKEN0cmwrRCB0byBzdG9wKTpcbiIpOwogICAgeXlsZXgoKTsKICAgIHJldHVybiAwOwp9