Advertisement
Filip13

taksi

Oct 3rd, 2022 (edited)
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <cmath>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.  
  10. double c1;
  11. cin >> c1;
  12. double c2;
  13. cin >> c2;
  14. double c3;
  15. cin >> c3;
  16.  
  17. double first_paying = c1 / 3;
  18. double second_paying = first_paying + ((c2 - c1) / 2);
  19. double third_paying = second_paying + c3 - c2;
  20.  
  21. cout << fixed << setprecision(2) << first_paying << endl;
  22. cout << fixed << setprecision(2) << second_paying << endl;
  23. cout << fixed << setprecision(2) << third_paying << endl;
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement