Skip to content

Commit cbb6e94

Browse files
committed
Upload file
1 parent 26c7db7 commit cbb6e94

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

patterns/rightLeanedDiamond.cpp

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

0 commit comments

Comments
 (0)