Below is the code that i wrote but it always shows"wrong answer" when i submit it.Can some please tell me what is wrong in it? thanx in advance...
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int x;
float y;
cin>>x;//withdraw
cin>>y;//balance
if(x<0||x>2000||y<0||y>2000)
return 0;
if(x>y)
{ cout.precision(2);
cout<<fixed<<y;
}
else
{ if (x%5==0)
{ cout.precision(2);
cout<<fixed<<y-x-0.50;
}
else
{ cout.precision(2);
cout<<fixed<<y;
}
}
return 0;
}