ATM problem
I’m new to codechef, I can’t understand what’s wrong in my code. It runs fine in custom input. please help!
#include<bits/stdc++.h>
using namespace std;
int main()
{
int amt;
float bal,ans;
cin>>amt>>bal;
if(amt%5==0 && amt+0.5<=bal)
{
ans=bal-amt-0.5;
cout<<fixed<<setprecision(2)<<ans<<endl;
}
else
cout<<fixed<<setprecision(2)<<bal<<endl;
return 0;
}