Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int wybor;
- int x;
- int y;
- cout << "wybierz opcje: " <<endl;
- cout << "1 - pole kwadratu " << endl;
- cout << "2 - pole prostokata" << endl;
- cin >> wybor ;
- if(wybor == 1)
- {
- cout << "podaj dlugosz boku" << endl;
- cin >> x;
- if(x>0)
- {
- cout << "OK" << endl;
- cout << x * x;
- }
- else
- {
- cout << "brak" << endl;
- }
- }
- if(wybor == 2)
- {
- cout << "podaj dlugosc boku" << endl;
- cin >> x;
- cout << "podaj szerokosc boku" << endl;
- cin >> y;
- if(x>0 && y>0)
- {
- cout << "OK" << endl;
- cout << x * y;
- }
- else
- {
- cout << "brak" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement