%{
#include <stdio.h>
%}
%%
[0-9]+ {
int num
= atoi
(yytext
); // Convert matched text to
integer if (num % 2 == 0) // Check if the number is even
printf("%d is Even\n", num);
else
printf("%d is Odd\n", num);
}
.|\n { /* Ignore other characters */ }
%%
int main() {
yylex
(); // Call the lexer to process input
return 0;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoKWzAtOV0rICAgICAgIHsKICAgICAgICAgICAgICAgIGludCBudW0gPSBhdG9pKHl5dGV4dCk7ICAvLyBDb252ZXJ0IG1hdGNoZWQgdGV4dCB0byBpbnRlZ2VyCiAgICAgICAgICAgICAgICBpZiAobnVtICUgMiA9PSAwKSAgICAgICAgLy8gQ2hlY2sgaWYgdGhlIG51bWJlciBpcyBldmVuCiAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIlZCBpcyBFdmVuXG4iLCBudW0pOwogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgIHByaW50ZigiJWQgaXMgT2RkXG4iLCBudW0pOwogICAgICAgICAgICB9CgoufFxuICAgICAgICAgIHsgLyogSWdub3JlIG90aGVyIGNoYXJhY3RlcnMgKi8gfQoKJSUKCmludCBtYWluKCkgewogICAgeXlsZXgoKTsgIC8vIENhbGwgdGhlIGxleGVyIHRvIHByb2Nlc3MgaW5wdXQKICAgIHJldHVybiAwOwp9Cg==