fork(1) download
  1. #include<iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int with;
  7. double bal;
  8. cin>>with>>bal;
  9. if(with<bal)
  10. {
  11. if((with%5)==0)
  12. {
  13. bal=bal-with;
  14. bal=bal-0.50;
  15. printf("%.2f",bal);
  16. }
  17. else
  18. printf("%.2f",bal);
  19. }
  20. else
  21. printf("%.2f",bal);
  22. }
Success #stdin #stdout 0.01s 2816KB
stdin
30 30.20
stdout
-0.30