Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void elka(int n);
- int main()
- {
- int n;
- cin >> n;
- elka(n);
- return 0;
- }
- void elka(int n)
- {
- for (int i = 0, c = 1; i < n / 2 + 1; i++, c += 2)
- {
- for (int j = 0; j < n / 2 - i; j++)
- {
- cout << " ";
- }
- for (int j = 0; j < c; j++)
- {
- cout << "*";
- }
- for (int j = 0; j < n / 2 - i; j++)
- {
- cout << " ";
- }
- cout << "\n";
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement