Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int m, n, wyb, pp;
- cout << "Podaj, ile wierszy ma miec ksztalt: ";
- cin >> m;
- cout << "Podaj, ile kolumn ma miec ksztalt: ";
- cin >> n;
- cout << endl;
- cout << "Wybierz symbol, ktorym chcesz narysowac prostokat: " << endl;
- cout << "1. wykorzystaj symbol | " << endl;
- cout << "2. wykorzystaj symbol + " << endl;
- cout << "3. wykorzystaj symbol - " << endl;
- cout << "4. wykorzystaj symbole a&b naprzemiennie " << endl;
- cin >> wyb;
- cout << endl;
- cout << "Wybierz, czy prostokat ma byc pelen, czy pusty: " << endl;
- cout << "1. prostokat pusty" << endl;
- cout << "2. prostokat pelny" << endl;
- cin >> pp;
- cout << endl;
- switch(pp)
- {
- case 1:
- {
- if(wyb==1)
- {
- for(int i=1;i<=m; i++)
- {
- if(i==1 || i==m)
- {
- for(int i=1; i<=n; i++)
- {
- cout << "|";
- }
- }
- else
- {
- for(int i=1; i<=n; i++)
- {
- if(i==1 || i==n)
- cout << "|";
- else
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- else if(wyb==2)
- {
- for(int i=1;i<=m; i++)
- {
- if(i==1 || i==m)
- {
- for(int i=1; i<=n; i++)
- {
- cout << "+";
- }
- }
- else
- {
- for(int i=1; i<=n; i++)
- {
- if(i==1 || i==n)
- cout << "+";
- else
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- else if(wyb==3)
- {
- for(int i=1;i<=m; i++)
- {
- if(i==1 || i==m)
- {
- for(int i=1; i<=n; i++)
- {
- cout << "-";
- }
- }
- else
- {
- for(int i=1; i<=n; i++)
- {
- if(i==1 || i==n)
- cout << "-";
- else
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- else if(wyb==4)
- {
- for(int i=1;i<=m; i++)
- {
- if(i==1 || i==m)
- {
- for(int i=1; i<=n; i++)
- {
- if(i%2==1)
- cout << "a";
- else
- cout << "b";
- }
- }
- else
- {
- for(int i=1; i<=n; i++)
- {
- if(i==1 || i==n)
- {
- if(i%2==1)
- cout << "a";
- else
- cout << "b";
- }
- else
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- break;
- default:
- break;
- }
- }
- system("Pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement