text stringlengths 49 983k |
|---|
#include<stdio.h>
int n,m;
void proc(){
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
printf("%c",((i+j)%2==0)?'#':'.');
}
printf("\n");
}
printf("\n");
}
int main(){
while(true){
scanf("%d%d",&n,&m);
if(!n&&!m)return 0;
proc();
}
} |
#include<stdio.h>
int main() {
int a, b,i,j;
while (scanf("%d %d", &a, &b) && a&&b) {
for (i = 1; i <= a; ++i) {
for (j = 1; j <= b; ++j) {
if ((i+j) % 2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
|
#include<stdio.h>
int main()
{
int a,b,c,x,y,z,i,j;
for(int t=1;;t++)
{
scanf("%d %d",&i,&j);
if(i==0&&j==0) break;
for(x=1;x<=i;x++)
{
for(y=1;y<=j;y++)
{
if((x%2==1&&y%2==0)||(x%2==0&&y%2==1))printf(".");
else printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <stdio.h>
int main(){
int n,m;
bool f;
while(1){
scanf("%d%d",&n,&m);
f=true;
if(n==0)return 0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(f){
printf("#");
f=false;
}
else{
printf(".");
f=true;
}
}
if(m%2==0)f=!f;
printf("\n");
}
printf("\n");
}
} |
#include<iostream>
using namespace std;
int main()
{
int h,w;
while(cin >> h >> w){
if(!h && !w)
break;
for(int i = 0;i<h;++i){
for(int j=0;j<w;++j){
if((i+j)%2 == 0)
cout << '#';
else
cout << '.';
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
while(1){
int H,W,s,k;
cin>>H>>W;
if(W==0&&H==0){break;}
for(k=0;k<H;k++){
for(s=0;s<W;s++){
if((s+k)%2==1){cout<<".";}
else{cout<<"#";}
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include <iostream>
int main(){
int H,W;
while(1){
std::cin >> H >> W;
if(H == 0 && W ==0){break;}
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2 == 0){std::cout << "#";}
else if((i+j)%2 == 1){std::cout << ".";}
}
std::cout << std::endl;
}
std::cout << std::endl;
}
} |
#include <cstdio>
int main(){
int a, b;
while(1){
scanf("%d%d", &a, &b);
if(a == 0 && b == 0) return 0;
for(int i = 0; i < a; i++){
for(int j = 0; j < b; j++){
if((i+j)%2==0) putchar('#');
else putchar('.');
}
puts("");
}
puts("");
}
}
|
#include <stdio.h>
#include <math.h>
int main(){
int h,w;
while(1){
scanf("%d %d",&h,&w);
if(h==0 && w==0) break;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if((i+j)%2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
int h,w;
while(cin >> h >> w && (h|w)){
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if((i + j) % 2 == 0) cout << '#';
else cout << '.';
}
cout << endl;
}
cout << endl;
}
} |
#include<stdio.h>
int main(){
int h,w;
int i,j;
scanf("%d %d",&h,&w);
while(h!=0||w!=0){
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if((i+j)%2==0){
printf("#");
}else{
printf(".");
}
}
printf("\n");
}
printf("\n");
scanf("%d %d",&h,&w);
}
return(0);
} |
#include <iostream>
using namespace std;
int main() {
int a, b;
while (true) {
cin >> a >> b;
if (a == 0 && b == 0) { break; }
for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
if ((i + j) % 2 == 0) { cout << '#'; }
else { cout << '.'; }
}
cout << endl;
}
cout << endl;
}
}
|
#include <iostream>
using namespace std;
int main(){
int H,W;
while(cin >> H >> W,H||W){
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2) cout << ".";
else cout <<"#";
}
cout <<endl;
}
cout << endl;
}
return 0;
} |
#include <iostream>
using namespace std;
int main() {
int H, W;
while(1){
cin >> H >> W;
if(H==0 && W==0) break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if(!((i+j)%2)) cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
int h, w;
while(cin >> h >> w && (h || w)){
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++) cout << "#."[(i + j) % 2];
cout << endl;
}
cout << endl;
}
} |
#include <iostream>
using namespace std;
int main()
{
int h, w;
while (cin >> h >> w, h || w)
{
for (int i = 0; i < h; i++)
{
for (int j = 0; j < w; j++) cout << ((i + j) % 2 == 0 ? '#' : '.');
cout << endl;
}
cout << endl;
}
}
|
#include <iostream>
using namespace std;
int main(){
int H,W;
for(;;){
cin>>H>>W;
if(H==0 && W==0){
break;
}
for(int i=0; i<H; i++ ){
for(int j=0; j<W; j++){
if((i+j)%2==0){
cout<<"#";
}else if((i+j)%2==1){
cout<<".";
}
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
int H,W;
while(1){
cin>>H>>W;
if(H==0&&W==0)break;
for(int i=0;i<H;i++){
for(int x=0;x<W;x++){
if((i+x)%2==0){
cout<<'#';
}
else {cout<<'.';
}
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include <iostream>
using namespace std;
int main()
{
while(true){
int H,W,k=0;
cin>>H>>W;
if(H==0&&W==0) break;
while (k<H)
{
for(int i=0;i<W;i++){
if(k%2==1&&i%2==1||k%2==0&&i%2==0)cout<<"#";
else cout<<".";
}
cout<<endl;
k++;
}
cout<<endl;
}
return 0;
}
|
#include <iostream>
using namespace std;
int main()
{
int h, w;
cin >> h >> w;
while ((h!=0)&&(w!=0)) {
for (int i=0; i < h; i++) {
for ( int j=0; j < w ; j++)
if((i+j)%2)
cout << '.';
else
cout << '#';
cout << endl;
}
cout << endl;
cin >> h >> w;
}
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
int main(){
while(true){
int h, w;
cin >> h >> w;
char ct[] = {'#', '.'};
if(h == 0) break;
for(int i=0; i<h; i++){
for(int j=0; j<w; j++){
cout << ct[(i+j)%2];
}
cout << "\n";
}
cout << "\n";
}
cout << flush;
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
while(cin>>h>>w&&h&&w){
for(int i=1;i<=h;++i){
for(int j=1;j<=w;++j){
if(i%2==j%2) cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include<stdio.h>
int main(void)
{
int a,s,d,f,g,h,j,i;
while(1){
scanf("%d %d",&a,&s);
if(a==0&&s==0)
break;
for(i=0;i<a;i++){
for(j=0;j<s;j++){
if((i+j)%2==1)
printf(".");
else
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <iostream>
using namespace std;
int main(void){
for(;;){
int h,w;
cin>>h>>w;
if(!h) break;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++) cout<<((i+j)%2?".":"#");
cout<<endl;
}
cout<<endl;
}
}
|
#include<iostream>
using namespace std;
int main(){
while(1){
int H,W;
cin >> H >> W;
if(H== 0 && W == 0)break;
for(int i=1;i<=H;++i){
for(int j =1;j<=W;++j){
if((i + j) % 2 ==0){
cout <<"#";
}
else{
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include<stdio.h>
int main(void){
int i,j,H,W;
for(scanf("%d%d",&H,&W);H!=0||W!=0;scanf("%d%d",&H,&W)){
for(i=0;i<H;i++){
for(j=0;j<W;j++){
putchar((i+j)%2?'.':'#');
}
putchar('\n');
}
putchar('\n');
}
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
int main(){
while(1){
int H, W;
cin>>H>>W;
if(H==0&&W==0)break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2==0)cout<<"#";
if((i+j)%2!=0)cout<<".";
}cout<<endl;
}cout<<endl;
}
return 0;
}
|
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int main() {
int h, w;
while (cin >> h >> w, h) {
rep(i, h) {
rep(j, w) {
if ((i + j) & 1)cout << ".";
else cout << '#';
}
cout << endl;
}
cout << endl;
}
} |
#include<iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
while (h != 0) {
int i, j;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
if ((i+j)%2==0)
cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
cin >> h >> w;
}
return(0);
}
|
#include <iostream>
using namespace std;
int main(){
int H,W;
while(cin >> H >> W){
if(H==0&&W==0) break;
for(int i=0;i<H;i++){
for(int j =0 ; j<W ; j++){
if(i%2==0 && j%2==0 || j%2==1 && i%2==1) cout << "#";
else cout << ".";
}
cout << "\n";
}
cout << "\n";
}
} |
#include<stdio.h>
int main() {
int n, m;
while (scanf("%d %d", &n, &m), n + m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++)
if ((i + j)%2==0)
putchar('#');
else putchar('.');
puts("");
}
puts("");
}
return 0;
} |
#include <iostream>
using namespace std;
int main()
{
int h,w;
while(1)
{
cin>>h>>w;
if((h==0)&&(w==0)) break;
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
cout<<(((i+j)%2==0)?'#':'.');
cout<<endl;
}
cout<<endl;
}
} |
#include<iostream>
using namespace std;
int main(){
int a=1,b=1;
while(!(a==0&&b==0)){
cin >> a >> b;
for (int i=1;i<=a;i++){
for(int j=1;j<=b;j++)
if ((i+j)%2==0)
cout << '#';
else cout << '.';
cout << endl;
}
if(!(a==0&&b==0))
cout << endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
while(1){
int h,w;
cin >> h >> w;
if(h==0&&w==0) break;
for(int i=1;i<=h;++i){
for(int j=1;j<=w;++j){
if((i+j)%2==0) cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include<cstdio>
#include<iostream>
using namespace std;
int main(void){
int H,W;
while(1){
cin>>H>>W;
if(H==0&&W==0) break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2==0) cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include <iostream>
using namespace std;
int H,W;
int main() {
while(true) {
cin >> H >> W;
if(H == 0 && W == 0) break;
for(int i=0; i<H; ++i) {
for(int k=0; k<W; ++k) {
if( (i+k) % 2 ) cout << ".";
else cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include <cstdio>
int main(){
int i,j,h,w;
while(true){
scanf("%d %d",&h,&w);
if ((h==0)&&(w==0)) break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
printf((i+j)%2==0?"#":".");
};
printf("\n");
}
printf("\n");
}
return 0;
}; |
#include<bits/stdc++.h>
using namespace std;
int main(){
stringstream ss;
while(true){
int h,w,i,j;
cin>>h>>w;
if(h+w==0)break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if((i+j)%2) ss<<".";
else ss<<"#";
}
ss<<endl;
}
ss<<endl;
}
cout<<ss.str();
}
|
#include<iostream>
using namespace std;
int main(){
int h, w;
while(1){
cin >> h >> w;
if(h==0 && w==0){ break; }
for(int i=0; i<h; i++){
for(int j=0; j<w; j++){
if((i+j)%2==0){
cout << "#";
}else{
cout << ".";
}
}
cout << "\n";
}
cout << "\n";
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
int h,w;
while(cin >> h >> w,h*w){
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if((i + j)%2==0) cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
while(1){
int h,w;
cin >> h >> w;
if(h == 0 && w == 0){
break;
}
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
if((i + j) % 2 == 0){
cout << "#";
}
else{
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
} |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int H, W;
while (cin >> H >> W, H || W) {
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cout << (((i + j) & 1) ? '.' : '#');
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include<bits/stdc++.h>
using namespace std;
signed main(){
int a,b;
while(scanf("%d%d",&a,&b),a||b){
for(int c=0;c<a;c++){
for(int d=0;d<b;d++){
if((c+d)&1) printf(".");
else printf("#");
}
printf("\n");
}
printf("\n");
}
} |
#include<iostream>
using namespace std;
int main(){
int H,W;
while(1){
cin>>H>>W;
if(H==0&&W==0){break;}
for(int i=0;i<H;i++){
int write;
if(i%2==0){write=1;}else{write=0;}
for(int j=0;j<W;j++){
if(j%2==write){cout<<".";}else{cout<<"#";}
}
cout<<"\n";
}
cout<<"\n";
}
return 0;
} |
#include <iostream>
int main(){
int h;
int w;
while(true){
std::cin>>h;
std::cin>>w;
if(h==0&&w==0){
break;
}
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
std::cout<<((i+j)%2==0?"#":".");
}
std::cout<<std::endl;
}
std::cout<<std::endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(void)
{
while(true)
{
int h,w;
cin>>h;
cin>>w;
if(h==0 && w==0)break;
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
{
if((i+j)%2==0)cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include<bits/stdc++.h>
using namespace std;
int main(){
while(1){
int H, W;
cin>>H>>W;
if(H == 0 && W == 0) break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if(i % 2 == 0 && j % 2 == 0 || i % 2 == 1 && j % 2 ==1) cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int H , W;
while(cin >> H >> W , H || W)
{
for(size_t i = 0; i < H; i++)
{
for(size_t j = 0; j < W; j++)
{
cout << ( ( i + j ) % 2 ? '.' : '#' );
}
cout << endl;
}
cout << endl;
}
} |
#include<stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b);
while(a!=0 && b!=0){
for(int i=0; i<a; i++){
for(int j=0; j<b; j++){
if((i+j)%2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
scanf("%d %d", &a, &b);
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main(void){
int h, w;
while(1){
cin >> h >> w;
if(h == 0 && w == 0) break;
for(int i=0; i<h; i++){
for(int j=0; j<w; j++){
if((j+i)%2 == 0) cout << "#";
else cout << ".";
}
puts("");
}
puts("");
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int H, W;
while (true){
cin >> H >> W;
if (H == 0 && W == 0)break;
for (int i = 1; i <= H; i++){
for (int j = 1; j <= W; j++){
if ((i-j) % 2 == 0)cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include <stdio.h>
int main(void)
{
char x[2] = {'#', '.'};
int W, H, i, j, n;
while(1) {
scanf("%d %d",&H,&W);
if(H == 0 && W == 0)
break;
for(j = 0; H > j; j++){
i = j % 2;
n = 0;
while(W > n){
printf("%c", x[i % 2]);
n++;
i++;
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include<stdio.h>
int main(){
int H, W, i, j;
while(1){
scanf("%d %d\n", &H, &W);
if(H==0)return 0;
for(i=0;i<H;i++){
for(j=0;j<W;j++) putchar((i+j)%2==0 ? '#' : '.');
putchar('\n');
}
putchar('\n');
}
}
|
#include<iostream>
int main(){
int i,j,h,w;
while(1){
std::cin >> h >> w;
if(h == 0 && w == 0) return 0;
for(i=0; i<h; i++){
for(j=0; j<w; j++) std::cout << ((i + j) % 2 ? "." : "#");
std::cout << std::endl;
}
std::cout << std::endl;
}
} |
#include <iostream>
using namespace std;
int main(){
while(1){
int H,W;
cin >> H >> W;
if(H == 0 && W == 0)break;
for(int i=1; H>=i; i++){
for(int j=1; W>=j; j++){
if( (i+j)%2 == 0)cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include <stdio.h>
int main(){
int H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H!=0 && W!=0){
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if((i+j)%2==0){
printf("#");
}else{
printf(".");
}
}
printf("\n");
}
}else{
break;
}
printf("\n");
}
} |
#include<bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int h, w;
cin >> h >> w;
if (h == 0 && w == 0)break;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if ((i + j) % 2 == 0)cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
}
|
#include <iostream>
int main(void){
using namespace std;
int H, W, i, j;
while(cin >> H >> W){
if(H == 0 && W ==0)
break;
for(i = 0; i < H; i++){
for(j = 0; j < W; j++){
if((i+j+2)%2)
cout << ".";
else
cout << "#";
}
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include<stdio.h>
int main() {
int H, W;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0)break;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (j % 2 == i % 2)printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
|
#include <stdio.h>
int main() {
int h, w;
for(;;) {
scanf("%d %d", &h, &w);
if(h==0) break;
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
if((i+j)%2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
}
|
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
while(1){
int h,w;
cin >> h >>w;
if(h==0 && w==0) break;
for(int i=0; i<h; i++){
for(int j=0; j<w; j++){
if((i+j)%2 == 0) cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
while (true){
int H, W;
cin >> H >> W;
if (H==0 && W==0) break;
for (int i=1; i<=H; i++){
for (int j=1; j<=W; j++){
if (i%2 == j%2) cout << '#';
else cout << '.';
}
cout << endl;
}
cout << endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int n, m;
while (cin >> n >> m && n || m){
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
if ((i + j) % 2 == 0)cout << '#';
else cout << '.';
}
cout << endl;
}cout << endl;
}
return 0;
}
|
#include<stdio.h>
int main(){
int W,H;
int i,j;
while(1){
scanf("%d %d",&W,&H);
if(W == 0 && H == 0) break;
for(i=1;i<=W;i++){
for(j=1;j<=H;j++){
if((i+j)%2 == 0){
printf("#");
}
else{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <iostream>
using namespace std;
int main() {
int h,w,i,j;
while(cin>>h>>w,h) {
for(i=0;i<h;i++) {
for(j=0;j<w;j++) {
if((i+j)%2) {
cout<<".";
}
else {
cout<<"#";
}
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int H,W;
while(true){
cin>>H>>W;
if(H==0 && W==0)break;
for(int i=0;i<H;++i){
for(int j=0;j<W;++j){
if((i+j)%2==0)
cout<<"#";
else
cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int H,W;
while(true)
{
cin >> H >> W;
if(H+W == 0) break;
for(int i=0;i<H;i++)
{
for(int k=0;k<W;k++)
{
if((i+k)%2 == 0) cout << "#";
else cout << ".";
}
cout << "\n";
}
cout << "\n";
}
return 0;
}
|
#include <iostream>
using namespace std;
int main()
{
int a, b;
while (cin >> a, cin >> b, a or b) {
for (int i=0; i<a; ++i) {
for (int j=0; j<b; ++j)
cout << ((!((i+j) % 2)) ? '#' : '.');
cout << endl;
}
cout << endl;
}
}
|
#include<iostream>
using namespace std;
int main(){
int h,w;
while(cin>>h>>w, h+w){
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(((i+j)&1) == 0)
cout<<"#";
else
cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include<iostream>
using namespace std ;
int main()
{
int h ,w ;
char str[ 2 ][ 3 ] = { { "#." } ,{ ".#" } , } ;
while( cin >> h >> w ,h | w )
{
for( int i = 0 ; i < h ; i++ )
{
for( int j = 0 ; j < w ; j++ )
cout << str[ i % 2 ][ j % 2 ] ;
cout << endl ;
}
cout << endl ;
}
return 0 ;
} |
#include <iostream>
using namespace std;
int main()
{
int H,W;
while(1){
cin>>H>>W;
if(H==0 && W==0){break;}
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2==0){cout<<"#";}
else{cout<<".";}
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include <iostream>
int main(void) {
int h, w;
for (;;) {
std::cin >> h >> w;
if (h == 0 && w == 0) { break; }
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
std::cout << ((x + y) % 2 == 0
? "#"
: ".");
}
std::cout << "\n";
}
std::cout << std::endl;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int H,W,i,j;
while(1){
cin>>H>>W;
if(H==0&&W==0)break;
for(i=0;i<H;i++){
for(j = 0;j < W;j++){
if((i+j+2)%2==0)cout<<"#";
else if((i+j+2)%2==1)cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include<iostream>
#include<string>
using namespace std;
int main(){
int h,w;
while(cin>>h>>w){
if(h==0&&w==0)
break;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if((i+j)%2==0)
cout<<"#";
else
cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
int H, W;
while(cin >> H >> W && H != 0 && W != 0){
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
if((j + i) % 2 == 0 ){
cout << "#";
}else{
cout << ".";
}
}
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
int h,w;
for(;;){
cin>>h>>w;
if(h,w==0){
break;
}
for(int i=1;i<=h;i++){
for(int j=1;j<=w;j++){
if((i+j)%2==0){
cout<<"#";
}else{
cout<<".";
}
}
cout<<endl;
}
cout<<endl;
}
} |
#include<cstdio>
int main(void){
int w;
int h;
for(;;){
scanf("%d %d",&w,&h);
if(w==0&&h==0) break;
else{
for(int i=0;i<w;i++){
for(int j=0;j<h;j++){
if((i+j)%2==0)printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
}
return 0;
} |
#include <stdio.h>
int main(){
int h,w;
while(1){
scanf("%d %d",&h,&w);
if(h==0&&w==0){break;}
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
printf("%c",((i+j)%2==0)?'#':'.');
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
int main(){
for(int h,w;cin>>h>>w,h;){
for(int i=1;i<=h;i++){
for(int j=1;j<=w;j++){
if((i+j)%2==0)cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
while(a!=0&&b!=0){
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
if((i%2==0&&j%2==0)||(i%2==1&&j%2==1)){
cout<<"#";
}
else cout<<".";
}
cout<<endl;
}
cout<<endl;
cin>>a>>b;
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int h,w;
while(1){
cin>>h>>w;
if(h==0&&w==0)break;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(0==(i+j)%2)cout<<"#";
else cout<<".";
}
cout<<endl;
}
cout<<endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
int H,W;
while(1){
cin>>H>>W;
if(H==0&&W==0) break;
for(int i=0;i<H;i++){
for(int h=0;h<W;h++){
if((i+h)%2==0)cout<<"#";
else if((i+h)%2==1)cout<<".";
}
cout<<endl;
}
cout<<endl;
}
} |
#include<iostream>
using namespace std;
int main(){
int h,w;
while(cin>>h>>w,1){
if(h==0&&w==0)return 0;
for(int i=1;i<=h;i++){
for(int n=1;n<=w;n++){
if((i+n)%2==0)cout<<"#";
else cout<<".";
}cout<<endl;
}cout<<endl;
}
}
|
#include<iostream>
using namespace std;
int main (){
int j,k,H,W;
while(1){
cin>>H>>W;
for(j=1;j<=H;j++){
for(k=1;k<=W;k++){
if((j+k)%2==0){
cout<<"#";
}
else{
cout<<".";
}
}
cout<<endl;
} if(H==0&&W==0){
break;
}cout<<endl;
}
return 0;
}
|
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int H,W;
while(1){
cin>>H>>W;
if(H==0&&W==0)
break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2)
cout<<".";
else
cout<<"#";
}
cout<<endl;
}
cout<<endl;
}
return 0;
} |
#include <cstdio>
int main(){
int a,b;
while(true){
scanf("%d %d",&a,&b);
if(a==0) break;
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
if((i+j)%2)printf(".");
else printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
while(cin>>n>>m&&n){
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if((i%2==0&&j%2==0)||(i%2==1&&j%2==1))cout<<'#';
else cout<<'.';
}cout<<endl;
}cout<<endl;
}
return 0;
}
|
#include<stdio.h>
using namespace std;
int main(){
while(1){
int h, w;
scanf(" %d %d", &h, &w);
if(h==0 && w==0) break;
for(int i=0; i<h; ++i){
for(int j=0; j<w; ++j){
if( (i+j)%2==0 ) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
|
#include <iostream>
using namespace std;
int main()
{
int h, w;
while (true)
{
cin >> h >> w;
if ((h == 0) && (w == 0))break;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cout << (((i + j) % 2 == 0) ? "#" : ".");
}
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include<iostream>
using namespace std;
int main(){
int H,W;
while(1){
cin >>H >>W;
if (H==0&&W==0) break;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
if((i+j)%2==0){
cout <<'#';
}
else cout <<'.';
}
cout <<"\n";
}
cout <<endl;
}
return 0;
} |
#include <cstdio>
using namespace std;
int main() {
int H,W;
while(1) {
scanf("%d%d",&H,&W);
if(H==0 && W==0) break;
for(int j=0;j<H;++j) {
for(int i=0;i<W;++i){
if((i+j)%2==0) {
printf("#");
} else {
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include <iostream>
using namespace std;
int main(){
int H, W;
for (int i = 0; ; i++){
cin >> H >> W;
if (H==0 && W==0) break;
for (int h=0; h<H; h++){
for (int w=0; w<W; w++){
if ((h+w)&1) cout << '.';
else cout << '#';
}
cout << endl;
}
cout << endl;
}
} |
#include <stdio.h>
int main(){
while(1){
int h, w;
scanf(" %d %d", &h, &w);
if(h==0 && w==0) break;
for(int i=0; i<h; ++i){
for(int j=0; j<w; ++j){
if( (i+j)%2==0 ) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
|
#include <iostream>
using namespace std;
int main(){
int h, w;
while (cin >> h >> w && h) {
for (int i=0; i<h; i++) {
for (int j=0; j<w; j++)
cout << ((i+j)&1 ? '.' : '#');
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main(){
while(1){
int h,w;
cin >> h >> w;
if(h == 0 && w ==0) break;
for(int i = 0;i < h;i++){
for(int j = 0;j < w;j++){
if((i + j)%2 == 0) cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
}
return 0;
}
|
#include <stdio.h>
int main(){
int h,w;
int i,j;
scanf("%d %d",&h,&w);
while(h||w){
for(i=0;i<h;i++){
for(j=0;j<w;j++){
printf((i+j)%2? "." : "#");
}
printf("\n");
}
printf("\n");
scanf("%d %d",&h,&w);
}
} |
#include <stdio.h>
int main(void)
{
char x[2] = {'#', '.'};
int W, H, i, j, n;
while(1) {
scanf("%d %d",&H,&W);
if(H == 0 && W == 0)
break;
for(j = 0; H > j; j++){
i = j % 2;
for(n = 0; W > n; n++){
printf("%c", x[i % 2]);
i++;
}
printf("\n");
}
printf("\n");
}
return 0;
} |
#include<iostream>
using namespace std;
int main(){
int H,W;
while(true){
cin >> H >> W;
if(H == 0 && W == 0) break;
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
if((i+j)%2 == 0) cout <<"#";
else cout << ".";
}
cout << "\n";
}
cout << "\n";
}
}
|
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int H,W;
cin >> H >> W;
while(H!=0&&W!=0)
{
for (int i=0;i<H;i++)
{
for (int j=0;j<W;j++)
{
if((i%2+j%2)%2==0)cout << "#";
else cout << ".";
}
cout << endl;
}
cout << endl;
cin >> H >> W;
}
}
|
#include <iostream>
int main() {
int h, w;
while (std::cin >> h >> w, h | w) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
std::cout << ((i + j) % 2 ? "." : "#");
}
std::cout << "\n";
}
std::cout << std::endl;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.