请看下面的代码
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double balance=0;
int withdraw = 0;
double const bankCharges = 0.5;
cin >> withdraw >> balance;
if(withdraw%5==0 && balance>(withdraw+bankCharges))
{
cout << fixed << setprecision(2) << ((balance)-(withdraw+bankCharges)) << endl;
}
else if(withdraw%5!=0 || withdraw>balance)
{
cout << fixed <<setprecision(2) << balance << endl;
}
return 0;
}
创建上面的代码是为了解决以下挑战
http://www.codechef.com/problems/HS08TEST
如您所见,我的代码提供了正确的答案。但是测试引擎说“错误答案”!!!!为什么?请帮忙!