%{
#include <stdio.h>
int num1, num2;
%}

%%

[0-9]+  {
            if (num1 == 0) {
                num1 = atoi(yytext);
            } else {
                num2 = atoi(yytext);
            }
        }

"+"     {
            ; // This simply matches the plus sign, no action needed
        }

\n      {
            printf("Sum: %d\n", num1 + num2);
            num1 = 0;
            num2 = 0;
        }

.       { ; }

%%

int main() {
    num1 = 0;
    num2 = 0;
    yylex();
    return 0;
}
