Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int kolumny, wiersze;
- cout << "Podaj liczbe kolumn i wierszy: ";
- cin >> kolumny >> wiersze;
- for(int i = 0; i < wiersze; i++)
- {
- for(int j =0; j < kolumny; j++)
- {
- if(i < wiersze / 2)
- {
- if(j < i || kolumny - j <= i)
- cout << '*';
- else
- cout << '#';
- }
- else
- {
- if(j < (wiersze - i - 1) || (kolumny - j) <= (wiersze - i - 1))
- cout << '*';
- else
- cout << '#';
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment