Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int space, rows;
- char dw;
- do
- {
- system("cls");
- cout << "Enter number of rows: ";
- cin >> rows;
- cout<<endl;
- for (int i = 1, k = 0; i <= rows; ++i, k = 0)
- {
- for (space = 1; space <= rows - i; ++space)
- {
- cout << " ";
- }
- while (k != 2 * i - 1)
- {
- cout << "* ";
- ++k;
- }
- cout << endl;
- }
- cout << "\nTry again?[Y/N]: ";
- cin >> dw;
- } while (dw == 'Y' || dw == 'y');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement