#include
#include
int main()
{
using namespace std;
int wdraw;
float bal;
float left;
cin >> wdraw;
cin >> bal;
if(wdraw <= bal)
{
if(wdraw%5==0){
left = bal-wdraw-0.50;
cout << fixed << setprecision(2) << showpoint << left << endl;
}
else{
cout << fixed << setprecision(2) << showpoint << bal << endl;
}
}
else
{
cout << fixed << setprecision(2) << showpoint << bal << endl;
}
return 0;
}
this is the ATM question in the easy section of the practice problems.
on submitting ,it shows Wrong Answer.
I have tried every possible input and it is giving me the correct answer on my compiler.
please help.