%%{
#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;
}
JSV7CiNpbmNsdWRlIDxzdGRpby5oPgolJX0KCiUlClswLTldKyB7IAogICAgaW50IG51bSA9IGF0b2koeXl0ZXh0KTsgCiAgICBpZiAobnVtICUgMiA9PSAwKSAKICAgICAgICBwcmludGYoIiVzIGlzIEV2ZW5cbiIsIHl5dGV4dCk7IAogICAgZWxzZSAKICAgICAgICBwcmludGYoIiVzIGlzIE9kZFxuIiwgeXl0ZXh0KTsgCn0KXG4gICAgICB7IC8qIElnbm9yZSBuZXdsaW5lcyAqLyB9Ci4gICAgICAgeyAvKiBJZ25vcmUgb3RoZXIgY2hhcmFjdGVycyAqLyB9CiUlCgppbnQgbWFpbigpIHsKICAgIHByaW50ZigiRW50ZXIgbnVtYmVycyAoQ3RybCtEIHRvIHN0b3ApOlxuIik7CiAgICB5eWxleCgpOwogICAgcmV0dXJuIDA7Cn0=