Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. void f1() {
  7.     double a, b, w;
  8.    
  9.     cout << "---- FUNKCJA 1 ----" << endl;
  10.    
  11.     cout << "Podaj liczbe nr 1: ";
  12.     cin >> a;
  13.    
  14.     cout << "Podaj liczbe nr 2: ";
  15.     cin >> b;
  16.    
  17.     w = pow(a, 2) + pow(b, 2);
  18.     cout << "Wynik: " << w << endl << endl;
  19. }
  20.  
  21. void f2() {
  22.     double a, b, w;
  23.    
  24.     cout << "---- FUNKCJA 2 ----" << endl;
  25.    
  26.     cout << "Podaj liczbe nr 1: ";
  27.     cin >> a;
  28.    
  29.     cout << "Podaj liczbe nr 2: ";
  30.     cin >> b;
  31.    
  32.     w = pow(a, 2) - pow(b, 2);
  33.     cout << "Wynik: " << w << endl << endl;
  34. }
  35.  
  36. int main()
  37. {
  38.     f1();
  39.     f2();
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement