Skip to content

Commit 6b28ea6

Browse files
Add files via upload
1 parent 069c8a4 commit 6b28ea6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Pattern_Problem3.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int n;
6+
cin >> n;
7+
8+
for(int i=0; i<n; i++) {
9+
for(int j=0; j<n-i; j++) {
10+
cout << "*";
11+
}
12+
13+
for(int k=0; k<2*i; k++) {
14+
cout << " ";
15+
}
16+
17+
for(int j=0; j<n-i; j++) {
18+
cout << "*";
19+
}
20+
21+
cout << endl;
22+
}
23+
}

0 commit comments

Comments
 (0)