私はプログラミングが初めてです。Pelles C ide を使用して C をコンパイルしていますが、昨日は機能していましたが、現在このエラーが発生しています。
プロジェクトのコードは次のとおりです。
#include <stdio.h>
int main(void)
{
double operand1;
double result;
char operator;
double operand2;
printf("This is a calculator");
printf("Type a simple expression...");
scanf("%lf %s %lf", &operand1, &operator, &operand2);
if(operator == '+')
{
result = operand1 + operand2;
}
else if (operator == '-')
{
result = operand1 + operand2;
}
else if (operator == '*')
{
result = operand1 * operand2;
}
else if (operator == '/')
{
result = operand1 / operand2;
}
else
{
printf("Wrong input. Exiting.");
return 1;
}
printf("The answer is: %lf ", result);
return 0;
}
このエラーの原因は何ですか?
これもある、以前はあった記憶がない