Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int szerokosc, wysokosc, x, y;
- int main()
- {
- cout << "Witaj! Podaj szerokosc prostokata."<<endl;
- cin >> szerokosc;
- cout << "...i wysokosc."<<endl;
- cin >> wysokosc;
- for(int x=0;x<szerokosc;x++)
- {
- cout << "O";
- }
- //wypisanie gornej linii
- cout<<endl;
- for(int y=0;y<wysokosc;y++)
- {
- cout<<"O";
- for(x=2;x<szerokosc;x++)
- {
- cout<<" ";
- }
- cout<<"O"<<endl;
- }
- //wypisanie linii bocznych
- for(int x=0;x<szerokosc;x++)
- {
- cout << "O";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement