小朋友, 请你写出你的初始思路吧。
供参考:
#include<stdio.h>
int main()
{
int term, result;
char ch;
scanf("%d", &result);
getchar();
ch = getchar();
scanf("%d", &term);
getchar();
while (term != 0)
{
if (ch == '+')
result += term;
if (ch == '-')
result -= term;
ch = getchar();
scanf("%d", &term);
getchar();
}
printf("result:%d\n", result);
return 0;
}