fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. double n;
  6. cin>>n;
  7. if(n<500){
  8. n=n;
  9. }
  10. if(n>=500 and n<1000){
  11. n=n-(n/100)*5;
  12. }
  13. if(n>=1000 and n<7000){
  14. n=n-(n/100)*11;
  15. }
  16. if(n>=7000 and n<15000){
  17. n=n-(n/100)*18;
  18. }
  19. if(n>=7000 and n<=15000){
  20. n=n-(n/100)*18;
  21. }
  22. if(n>15000){
  23. n=n-(n/100)*25;
  24. }
  25. cout<<n<<endl;
  26. return 0;
  27. }
Success #stdin #stdout 0s 4336KB
stdin
3500.00
6850.00
375.80
690.50
12350.00
25314.18
3750.00
14200.50
895.80
1318.50
stdout
3115