-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPattern5.cpp
38 lines (35 loc) · 1.03 KB
/
Pattern5.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
/*
_ _ _ _ * _ _ _ _ _ _ _ * _ _ _ _ _ _ _ * _ _ _ _ _ _ _ * _ _ _ _ _ _ _ * _ _ _ _ _ _ _ * _ _ _ _
_ _ _ * * * _ _ _ _ _ * * * _ _ _ _ _ * * * _ _ _ _ _ * * * _ _ _ _ _ * * * _ _ _ _ _ * * * _ _ _
_ _ * * * * * _ _ _ * * * * * _ _ _ * * * * * _ _ _ * * * * * _ _ _ * * * * * _ _ _ * * * * * _ _
_ * * * * * * * _ * * * * * * * _ * * * * * * * _ * * * * * * * _ * * * * * * * _ * * * * * * * _
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
void func(int i, int j, int n){
int sizeRepeat = 2*(n-1);
if(i - j%sizeRepeat >= -(n-1) && i + j%sizeRepeat >= (n-1))
cout<<"* ";
else
cout<<"_ ";
}
void solve(){
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){ // Canvas Size
for(int j=0;j<(2*(n-1)*m)+1;j++){
func(i,j,n);
}
cout<<endl;
}
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
while(t--){
solve();
}
}