SHARE
TWEET

Untitled

a guest Mar 26th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. #include <conio.h>
  4. using namespace std;
  5. float pole();
  6. float r;
  7. int main()
  8. {
  9.     pole();
  10.     return 0;
  11. }
  12.  
  13. float pole ()
  14. {
  15.     int wybor;
  16.     cout << "Podaj wartość promienia: ";
  17.     cin >> r ;
  18.     cout << " Wybierz operację do wykonania:  \n 1 - obliczanie pola \n 2 - obliczanie objętości \n";
  19.     cin >> wybor;
  20.     switch (wybor)
  21.     {
  22.     case 1:
  23.     cout << "Pole kuli o promieniu " << r << " wynosi " << 4*M_PI*r*r << "\n";
  24.     break;
  25.     case 2:
  26.     cout << "Objętość kuli o promieniu " << r << " wynosi " << (4/3)*M_PI*r*r*r;
  27.     break;
  28.     deafult:
  29.     break;
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top