eolymp
bolt
Try our new interface for solving problems
Problems

Template

published at 1/2/24, 8:41:09 pm

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; } }

published at 2/15/24, 7:08:46 am

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; } }