#include <stdio.h>
int main()
{
int X = 200;
float Y = 1500;
printf("Enter your initial Balance and the Amount to be Withdrawn. Note the Values should lie between 0 and 2000");
scanf("%d", "%e", &X, &Y);
if ((0 < X < 2000) && (0 < Y < 2000)) {
if ((X < Y) && (X % 5 == 0)) {
Y = Y - X;
Y = Y - 0.5;
} else {
printf("%f", Y);
}
printf("%f", Y);
} else {
printf("The Input is Wrong");
}
return 0;
}
コードは基本的にいくつかの数値 X を要求します。Y からそれを引き、Y から追加の 0.5 を引きます。Y として指定する必要があります。コードは、使用されている許可されているよりも多くのメモリが原因である可能性がある実行時エラーを示しています。メモリ使用量を減らす方法や、プログラムにエラーがあるかどうかを確認する方法について、誰かヒントを教えてもらえますか?