Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int height;
- cout << "Enter a height\n";
- cin >> height;
- if (height < 1)
- {
- cout << "Height must be at least one.\n";
- return 0;
- }
- for (int row = 1; row <=height; row++)
- {
- for (int col = 1; col <=row; col++)
- {
- cout << "*";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement