This is my code for the following problem --> http://www.codechef.com/problems/HS08TEST
My Code
#include
using namespace std;
int main()
{
int withdraw;
float amount;
cin>>withdraw>>amount;
if(withdraw%5==0)
{
if(withdraw+0.5<=amount&&withdraw!=0)
cout<<amount-withdraw-0.05;
else
cout<<amount;
}
return 0;
}
emin3m
2
hey @agnesj0315
there are basically 3 mistakes in your code
- your code does not give any output if withdrawal amount in not a multiple of 5.that means you have not used if else loop properly.
2)this line is wrong amount-withdraw-0.05 as you can see in the question the bank charges are 0.5 not 0.05
3)as you can see the output have 2 decimal places,so in order to get that you have to use fixed & setprecision(2),and have to include #include iomanip
here is link to your code modified by me link text
happy coding
@emin3m
Thank you!! It works! 
Cant believe I didnt notice that extra zero! Oops!