整数のみだけど再帰で

#include <stdio.h>

int expression(void);
int term(void);
int factor(void);

int expression(void)
{
int term1 = term();
int ch;

while ((ch = getchar()) == ' ') ;

while ((ch == '+') || (ch == '-')) {
int term2 = term();

if (ch == '+') term1 += term2;
if (ch == '-') term1 -= term2;

while((ch = getchar()) == ' ') ;
}
ungetc(ch, stdin);

return term1;
}