Guest User

Untitled

a guest
Feb 22nd, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cmath>
  4. #include <cstdlib>
  5.  
  6.  
  7.  using namespace std;
  8.  
  9. int main()
  10. {
  11.  
  12. //1.    Napisać program obliczania wartości wyrażenia
  13. //wdl wzoru F = (3*z + 2*x +1)/2;
  14.  
  15.  
  16. double a,b;
  17. int F;
  18. double k;
  19.  
  20. int z = int(a);
  21. int x = int(b);
  22.  
  23.  
  24. cin>>z;
  25. cin>>x;
  26.  
  27.  
  28.  
  29.  
  30. F = (3*z + 2*x +1)/2;
  31. k = (3*a + 2*b + 1)/2;
  32.  
  33. cout<<"wynik w intach "<<F<<endl;
  34. cout<<"wynik w double "<<k<<endl;
  35.  
  36.  
  37.  
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment