eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Шаблон

опубликовано 02.01.2024, 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; } }

опубликовано 15.02.2024, 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; } }