宿題とか手伝えます
■ このスレッドは過去ログ倉庫に格納されています
0666デフォルトの名無しさん
NGNG#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;
}
■ このスレッドは過去ログ倉庫に格納されています