fork download
  1. #include <iostream>
  2. #include<iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int withdraw;
  8. float amount;
  9. cin>>withdraw>>amount;
  10.  
  11. if(withdraw%5==0)
  12. {
  13. if(withdraw+0.5<=amount&&withdraw!=0)
  14. cout<<fixed<<setprecision(2)<<amount-withdraw-0.5;
  15. else
  16. cout<<fixed<<setprecision(2)<<amount;
  17. }
  18. else
  19. cout<<fixed<<setprecision(2)<<amount;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3276KB
stdin
30 120.00
stdout
89.50