Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4.  
  5.  
  6. using namespace std;
  7.  
  8. void licz ( double a, double b, double c = 5.0 )
  9. {
  10. if (a <= b + 0.5){
  11. if ( fmod (a,c) == 0){
  12. cout << fixed << b - a - 0.50;
  13. }
  14. }
  15. else { cout << fixed << b;}
  16. }
  17.  
  18.  
  19.  
  20. int main( double a = 0, double b = 0)
  21. {
  22. cout.precision(2);
  23. cin >> a >> b ;
  24.  
  25. licz(a,b);
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement