1

私はプログラミングが初めてです。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;

}

このエラーの原因は何ですか?

これもある、以前はあった記憶がない ここに画像の説明を入力

4

1 に答える 1

2

その特定の IDE を使用したことはありませんが、プロジェクトの種類が誤ってコンソールからWindows アプリケーションに変更されたようです。

于 2013-10-10T13:32:05.237 に答える