Advertisement
Guest User

zadanie_1

a guest
Jan 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a;
  4. double x, y;
  5.  
  6. void podpunkt_3(double arg_1, double arg_2){
  7.     double suma=arg_1+arg_2;
  8.     cout<<suma<<endl;
  9.     double roznica = arg_1 - arg_2;
  10.     cout<<roznica<<endl;
  11.     double iloczyn = arg_1 * arg_2;
  12.     cout<<iloczyn<<endl;
  13. }
  14. int main() {
  15.     cin>>a;
  16.     cin>>x;
  17.     cin>>y;     //wczytanie zmiennych
  18.  
  19.  
  20.     int nowa_1 = 2*a;
  21.     bool nowa_2 = a>y;
  22.     double nowa_3 = 2.5 * a; //podpunkt 1 - trzy nowe zmienne
  23.  
  24.  
  25.     x*=2;
  26.     cout<<x<<endl;
  27.     x+=1;
  28.     cout<<x<<endl;
  29.     x*=x;
  30.     cout<<x<<endl; //podpunkt 2 - dzialania na x
  31.  
  32.     podpunkt_3(x, y);
  33.     podpunkt_3(5.0, x); //wywolanie funkcji podpunkt 3
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement