Untitled
Anonymous
plain_text
08/07/2024 10:08 AM
496 B
22
Indexable
#include <iostream>
using namespace std;
int main() {
int a=5;
for (int i = 1; i <= a; i++) {
for (int j = 0; j < a - i; j++) {
cout << " ";
}
for (int j = 0; j < 2 * i - 1; j++) {
cout << "*";
}
cout << endl;
}
return 0;
}
Editor is loading...
Leave a Comment