Advertisement
Guest User

praca domowa

a guest
Mar 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6.  
  7. int wybor;
  8. int x;
  9. int y;
  10. cout << "wybierz opcje: " <<endl;
  11. cout << "1 - pole kwadratu " << endl;
  12. cout << "2 - pole prostokata" << endl;
  13. cin >> wybor ;
  14.  
  15.  
  16. if(wybor == 1)
  17. {
  18. cout << "podaj dlugosz boku" << endl;
  19. cin >> x;
  20. if(x>0)
  21. {
  22. cout << "OK" << endl;
  23. cout << x * x;
  24. }
  25. else
  26. {
  27. cout << "brak" << endl;
  28. }
  29.  
  30.  
  31. }
  32. if(wybor == 2)
  33. {
  34. cout << "podaj dlugosc boku" << endl;
  35. cin >> x;
  36. cout << "podaj szerokosc boku" << endl;
  37. cin >> y;
  38. if(x>0 && y>0)
  39. {
  40. cout << "OK" << endl;
  41. cout << x * y;
  42. }
  43. else
  44. {
  45. cout << "brak" << endl;
  46. }
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement