Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h" // само при Visual Studio <= 2017
- #include <iostream>
- #include <ctime> // заради time()
- using namespace std;
- //C++ program to display half star pyramid
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, i, j;
- cout << "Enter number of rows: ";
- cin >> n;
- for (i = 1; i <= n; i++)
- {
- for (j = n - i; j >= 0; j--)
- cout << " ";
- for (j = 1; j <= i; j++)
- cout << "* ";
- cout << "\n";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment