Advertisement
Guest User

zad1

a guest
Apr 8th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. float pole (float r, float h)
  7. {
  8.     float wynik = 2*M_PI*r*h+2*M_PI*pow(r, 2);
  9.     return wynik;
  10. }
  11. int main()
  12. {
  13.     float promien = 8;
  14.     float wysokosc = 4;
  15.     cout << "promien wynosi: " << pole(promien) << endl;
  16.     cout << "wysokosc wynosi: " <<  pole(wysokosc) << endl;
  17.     cout << "pole powierzchni wynosi: " <<pole(promien, wysokosc) << endl;
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement