eolymp
bolt
Try our new interface for solving problems
dərc olunub 02.01.24 20:41:09

include <bits/stdc++.h>

using namespace std; int main() { int n; cin>>n; for(int i=1; i<=n; i++) { if(i%2==1) for(int j=1; j<=n;j++) { if(j%2==1) cout<<"*"; else cout<<" "; } else for(int j=1; j<=n; j++) { if(j%2==1) cout<<" "; else cout<<"*"; } cout<<endl; } }

dərc olunub 15.02.24 07:08:46

include<bits/stdc++.h>

using namespace std; int main() { long long n,i,j; cin>>n; for(i=1; i<=n;i++){ for(j=1;j<=n;j++){ if((j+i)%2==0){ cout<<"*"; } else{ cout<<" "; } } cout<<endl; } }