Hourglass pyramid.cpp

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { for (int row = 2; row > 0; row--) { for (int col = 0; col < 3 - row; col++) { cout << " "; } cout << "*"; for (int col = 0; col < row * 2 - 1; col++) { cout << " "; } cout << "*"; cout << endl; } cout << " " << " " << " " << "*"; cout << endl; for (int row = 0; row < 2; row++) { for (int col = 0; col < 2 - row; col++) { cout << " " ; } cout << "*"; for (int col = 0; col < row * 2 + 1; col++) { cout << " "; } cout << "*"; cout << endl; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines