Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main ()
  5. {
  6. int a;
  7. int x;
  8. int y;
  9.  
  10. cout << "trojkat-1, prostokat-2, kwadrat-3"<< endl;
  11. cin >>a;
  12.  
  13. if (a==1)
  14. {
  15. cout << "podaj dlugosc bokow oraz wysokosci trojkata";
  16. cin >> x;
  17. cin >> y;
  18. cout << "pole trojkata jest rowne" << x*y;
  19. }
  20.  
  21. else
  22.  
  23. {
  24. if (a==2)
  25. {
  26. cout << "podaj dlugosc bokow prostokata";
  27. cin >> x;
  28. cin >> y;
  29. cout << "pole prostokata jest rowne" << x*y;
  30. }
  31. else
  32. {
  33. if (a==3)
  34. {
  35. cout << "podaj dlugosc boku kwadratu";
  36. cin >> x;
  37. cout << "pole kwadratu jest równe" << x*x;
  38. }
  39. else
  40. {
  41. if(a!=1|2|3)
  42. {
  43. cout << "ta liczba niestety nie psuje";
  44. }
  45.  
  46. }
  47.  
  48. }
  49.  
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement