criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;
int HW(int H,int W);
int main(void)
{
int h,w,x;
while(1)
{
cin>>h>>w;
if(h==0 && w==0)break;
x=HW(h,w);
}
return 0;
}

int HW(int H,int W)
{
int i=1;
for(int a=0;a<H;a++;){
    for(int b=0;b<W;b++;){
    int ii=1;
    if(i%2==1){
        if(ii%2==1){
            cout<<'#';
        }else{
            cout<<'.';
        }
    }else{
        if(ii%2==1){
            cout<<'.';
        }else{
            cout<<'#';
        }
    }
    ii+=1;
    }
i+=1;
cout<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int HW(int, int)':
a.cc:19:20: error: expected ')' before ';' token
   19 | for(int a=0;a<H;a++;){
      |    ~               ^
      |                    )
a.cc:19:21: error: expected primary-expression before ')' token
   19 | for(int a=0;a<H;a++;){
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int HW(int H,int W);
int main(void){
int h,w,x;
while(1){
cin>>h>>w;
if(h==0 && w==0){
break;
}
x=HW(h,w);
}
return 0;
}

int HW(int H,int W){
int i=1;
for(int a=0;a<H;a++;){
    for(int b=0;b<W;b++;){
    int ii=1;
    if(i%2==1){
        if(ii%2==1){
            cout<<'#';
        }else{
            cout<<'.';
        }
    }else{
        if(ii%2==1){
            cout<<'.';
        }else{
            cout<<'#';
        }
    }
    ii+=1;
    }
i+=1;
cout<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int HW(int, int)':
a.cc:18:20: error: expected ')' before ';' token
   18 | for(int a=0;a<H;a++;){
      |    ~               ^
      |                    )
a.cc:18:21: error: expected primary-expression before ')' token
   18 | for(int a=0;a<H;a++;){
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int HW(int H,int W);
int main(void){
int h,w,x;
while(1){
cin>>h>>w;
if(h==0 && w==0){
break;
}
x=HW(h,w);
}
return 0;
}

int HW(int H,int W){
int i=1;
for(int a=0; a<H; a++; ){
    for(int b=0;b<W;b++;){
    int ii=1;
    if(i%2==1){
        if(ii%2==1){
            cout<<'#';
        }else{
            cout<<'.';
        }
    }else{
        if(ii%2==1){
            cout<<'.';
        }else{
            cout<<'#';
        }
    }
    ii+=1;
    }
i+=1;
cout<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int HW(int, int)':
a.cc:18:22: error: expected ')' before ';' token
   18 | for(int a=0; a<H; a++; ){
      |    ~                 ^
      |                      )
a.cc:18:24: error: expected primary-expression before ')' token
   18 | for(int a=0; a<H; a++; ){
      |                        ^
Language: C++

include <stdio.h>

int main(void)
{
	int H,W,i,j; //??????H??¨???W
	
	while(1){
		scanf("%d %d", &H, &W);
		if(H == 0 && W == 0 )break;
		
		for( i = 1; i <= H; i++ ){			//i??????????´???§?????????
			for( j = 1; j <= W; j++ ){		//j???????´???§?????????
				
				if( j%2 == 1 ){				//i????\???°?????¨???
					if(i%2 == 1){			//j????\???°?????¨???
						printf("#");
					}else {
						printf(".");
					}
				}else if( j%2 == 0 ){		//i?????¶??°?????¨???
					if( i%2 == 0){			//???????????????#
						printf("#");
					}else {
						printf(".");
					}
				}	
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C++

#include<iostream>

using namespace std;

int main()
{
int x,y;
cin >> x;
cin >> y;

for (int i = 0; i < x; i++)
{
for (int j = 0; j < y; j++)
{
 if ((i + j) % 2 == 0)
  {cout << '#';
 else
  cout << '.';}
}
cout << '\n';
}
cout << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' before 'else'
   17 |  else
      |  ^~~~
a.cc:16:3: note: to match this '{'
   16 |   {cout << '#';
      |   ^
a.cc: At global scope:
a.cc:22:1: error: 'cout' does not name a type
   22 | cout << '\n';
      | ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#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%2 == 1){
                   if(j%2 == 1){
                       cout << "#";
                   }else if{
                       cout << ".";
                   }
               }else if{
                   if(j%2 == 1){
                       cout << ".";
                   }else if{
                       cout << "#";
                   }
               }
           }
       }
       cout << endl;
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: expected '(' before '{' token
   16 |                    }else if{
      |                            ^
      |                            (
a.cc:19:24: error: expected '(' before '{' token
   19 |                }else if{
      |                        ^
      |                        (
Language: C++

#include<cmath>
#include<iostream>
#include<cstdio>
#include<iomanip>
using namespace std;
int main() {
	int h, w;
	int cnt = 0;
	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 (cnt % 2 == 0)cout << "#";
				else cout << ".";
				cnt++;
			}
			cout << endl;
			if(w%2==0)cnt++;
		}
		j = 0;
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'j' was not declared in this scope
   21 |                 j = 0;
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <stddef.h>
#include <stack>
#include <queue>

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 ((h + j) % 2 == 0) cout << '#';
				else cout'.';
			}
			cout << endl;
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: expected ';' before '.'
   17 |                                 else cout'.';
      |                                          ^~~
      |                                          ;
Language: C++

put = ['#','.']
while(True):
        h,w = [int(i) for i in input().split()]
        if h==0 and w==0:
                break
        for i in range(h):
                out = ''
                if i % 2 == 0:
                    count = 0
                else :
                    count = 1 
                for j in range(w):
                        out += put[count%2]
                        count += 1
                print(out)
        print("")

Compiler output:
a.cc:7:23: error: empty character constant
    7 |                 out = ''
      |                       ^~
a.cc:1:1: error: 'put' does not name a type
    1 | put = ['#','.']
      | ^~~
Language: C++

#include <stdio.h>

int main(){

  int H,W,i,j;
  for({
    scanf("%d%d",&H,&W);
    if(H==0&&W==0) break;
    
    for(i=0;i<H;i++)
      {
      for(j=0;j<W;j++)
	{
	  if((i+j)%2==0){
	    printf("#");
	      }else{
	    printf(".");
	      }
	}
      printf("\n\n");
      }
  }
  return 0;
}
	  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: expected primary-expression before '{' token
    6 |   for({
      |       ^
a.cc:23:3: error: expected primary-expression before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:22:4: error: expected ';' before 'return'
   22 |   }
      |    ^
      |    ;
   23 |   return 0;
      |   ~~~~~~
a.cc:23:3: error: expected primary-expression before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:22:4: error: expected ')' before 'return'
   22 |   }
      |    ^
      |    )
   23 |   return 0;
      |   ~~~~~~
a.cc:6:6: note: to match this '('
    6 |   for({
      |      ^
Language: C++

#include <stdio.h>

int main(){

  int H,W,i,j;
  for(k=0;k<300;k++){
    scanf("%d%d",&H,&W);
    if(H==0&&W==0) break;
    
    for(i=0;i<H;i++)
      {
      for(j=0;j<W;j++)
	{
	  if((i+j)%2==0){
	    printf("#");
	      }else{
	    printf(".");
	      }
	}
      printf("\n\n");
      }
  }
  return 0;
}
	  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'k' was not declared in this scope
    6 |   for(k=0;k<300;k++){
      |       ^
Language: C++

#include <stdio.h>

int main(){

  int H,W,i,j;
  for(k=0;k<=300;k++){
    scanf("%d%d",&H,&W);
    if(H==0&&W==0) break;
    
    for(i=0;i<H;i++)
      {
      for(j=0;j<W;j++)
	{
	  if((i+j)%2==0){
	    printf("#");
	      }else{
	    printf(".");
	      }
	}
      printf("\n\n");
      }
  }
  return 0;
}
	  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'k' was not declared in this scope
    6 |   for(k=0;k<=300;k++){
      |       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int i,j,H,W;
  int a=i/2;
  int b=j/2;
  while(true){
    cin >> H >> W;
    if(H==0 && W==0)break;
    for(i=1;i<=H;i++){
      if(i==2*a){
        for(j=1;j<=W;j++){
          if(j==2*b){
            cout << "#";
          }
          else if(j==2*b+1){
            cout << ".";
          }
        }
      }
      cout << endl;
      else if(i==2*a+1){
        for(j=1;j<=W;j++){
          if(j==2*b){
            cout << ".";
          }
          else if(j==2*b+1){
            cout << "#";
          }
        }
      }
      cout << endl;
    }
  cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'else' without a previous 'if'
   22 |       else if(i==2*a+1){
      |       ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int i,j,H,W;
  while(true){
    cin >> H >> W;
    if(H==0 && W==0)break;
    for(i=1;i<=H,i++){
      int a=i/2;
      if(i==2*a+1){
        for(j=1;j<=W;j++){
          int b=j/2;
          if(j==2*b+1){
            cout << "#";
          }else{
            cout << ".";
          }
        }
        cout << endl;
      }else{
        for(j=1;j<=W;j++){
          int c=j/2;
          if(j==2*c+1){
            cout << ".";
          }else{
            cout << "#";
          }
        }
        cout << endl;
      }
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: expected ';' before ')' token
    8 |     for(i=1;i<=H,i++){
      |                     ^
      |                     ;
Language: C++

pattern = {
        0:["#", "."],
        1:[".", "#"],
    }

while True:
    (H, W) = [int(i) for i in input().split()]
    if H == W == 0:
        break
    for j in range(H):
        p = pattern[j % 2]
        print ("join([p[i % 2] for i in range(W)])")
    print()

Compiler output:
a.cc:1:1: error: 'pattern' does not name a type
    1 | pattern = {
      | ^~~~~~~
a.cc:6:1: error: expected unqualified-id before 'while'
    6 | while True:
      | ^~~~~
Language: C++

#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%2=0){
		if(j%2=0)
			cout << '#';
		else
			cout << '.';
		}
	else
		{
		if(j%2=0)
			cout << '.';
		else
			cout << '#';
		}

}
cout << endl;
}
cout << endl;
cin >> H>>W;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: lvalue required as left operand of assignment
   12 |         if(i%2=0){
      |            ~^~
a.cc:13:21: error: lvalue required as left operand of assignment
   13 |                 if(j%2=0)
      |                    ~^~
a.cc:20:21: error: lvalue required as left operand of assignment
   20 |                 if(j%2=0)
      |                    ~^~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int i, j, h, w;
	
	while(1){
		if ( h == 0 && w == 0 ) break;
		
		for( i = 0; i < h; i++ ){
			for ( j = 0; j < w; j++ ){
				if ( i + j % 2 == 0 || ( i == 0 && j == 0 )) 
					cout << "#";
				else 
					cout << ".":
			}
			cout << endl;
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:52: error: expected ';' before ':' token
   15 |                                         cout << ".":
      |                                                    ^
      |                                                    ;
Language: C++

object Main {
  def Print(x:Int,y:Boolean){
    var char=y
    for(i<-1 to x){
      if(char){
        print("#")
        char=false
      }
      else{
        print(".")
        char=true
      }
    }
    println()
  }
  def main(args:Array[String]){
    val sc=new java.util.Scanner(System.in)
    var tmp=false  
      while(true){
       val h,w=sc.nextInt
       var check=true
       if(tmp) println()
       if(h==0&&w==0) return
       for(i<-1 to h){
         Print(w,check)
         if(check) check=false
         else check=true
       }
       tmp=true
     }
  }
}

Compiler output:
a.cc:1:1: error: 'object' does not name a type
    1 | object Main {
      | ^~~~~~
Language: C++

#include <iostream>

#define MAX_SET (1000)

using namespace std;

void draw_chessboard(int H, int W);

int main()
{  
    int  i;
    int* H = new int[MAX_SET + 1];
    int* W = new int[MAX_SET + 1];
    int  size;

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> H[i] >> W[i];
         } while (H[i] > 300 || W[i] > 300);

         if (H[i] == 0 && W[i] == 0) {	    
             size = i;
	     break;
         }
    }
    
    for (int i = 0; i < size; i++) {
         draw_chessboard(H[i], W[i]) {     
         cout << endl;         
    }

    delete[] H;
    delete[] W;
 
    return (0);
} 

void draw_chessboard(int H, int W)
{    
     for (int i = 1; i <= H; i++) {
          if (i % 2 == 1) {
              for (int j = 1; j <= W; j++) {
	   	   if (j % 2 == 1) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
              }
          } else {
	      for (int j = 1; j <= W; j++) {
		   if (j % 2 == 0) {
		       cout << "#";
                   } else {
		       cout << ".":
                   }
	      }
          }

          cout << endl;
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected ';' before '{' token
   28 |          draw_chessboard(H[i], W[i]) {
      |                                     ^~
      |                                     ;
a.cc:39:1: error: a function-definition is not allowed here before '{' token
   39 | {
      | ^
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
Language: C++

    int  i;
    int* H = new int[MAX_SET + 1];
    int* W = new int[MAX_SET + 1];
    int  size;

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> H[i] >> W[i];
         } while (H[i] > 300 || W[i] > 300);

         if (H[i] == 0 && W[i] == 0) {	    
             size = i;
	     break;
         }
    }
    
    for (int i = 0; i < size; i++) {
         draw_chessboard(H[i], W[i]) {     
         cout << endl;         
    }

    delete[] H;
    delete[] W;
 
    return (0);
} 

void draw_chessboard(int H, int W)
{    
     for (int i = 1; i <= H; i++) {
          if (i % 2 == 1) {
              for (int j = 1; j <= W; j++) {
	   	   if (j % 2 == 1) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
              }
          } else {
	      for (int j = 1; j <= W; j++) {
		   if (j % 2 == 0) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
	      }
          }

          cout << endl;
     }
}

Compiler output:
a.cc:2:22: error: 'MAX_SET' was not declared in this scope
    2 |     int* H = new int[MAX_SET + 1];
      |                      ^~~~~~~
a.cc:3:22: error: 'MAX_SET' was not declared in this scope
    3 |     int* W = new int[MAX_SET + 1];
      |                      ^~~~~~~
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for (int i = 0; i < MAX_SET + 1; i++) {
      |     ^~~
a.cc:6:21: error: 'i' does not name a type
    6 |     for (int i = 0; i < MAX_SET + 1; i++) {
      |                     ^
a.cc:6:38: error: 'i' does not name a type
    6 |     for (int i = 0; i < MAX_SET + 1; i++) {
      |                                      ^
a.cc:17:5: error: expected unqualified-id before 'for'
   17 |     for (int i = 0; i < size; i++) {
      |     ^~~
a.cc:17:21: error: 'i' does not name a type
   17 |     for (int i = 0; i < size; i++) {
      |                     ^
a.cc:17:31: error: 'i' does not name a type
   17 |     for (int i = 0; i < size; i++) {
      |                               ^
a.cc: In function 'void draw_chessboard(int, int)':
a.cc:34:24: error: 'cout' was not declared in this scope
   34 |                        cout << "#";
      |                        ^~~~
a.cc:36:24: error: 'cout' was not declared in this scope
   36 |                        cout << ".";
      |                        ^~~~
a.cc:42:24: error: 'cout' was not declared in this scope
   42 |                        cout << "#";
      |                        ^~~~
a.cc:44:24: error: 'cout' was not declared in this scope
   44 |                        cout << ".";
      |                        ^~~~
a.cc:49:11: error: 'cout' was not declared in this scope
   49 |           cout << endl;
      |           ^~~~
a.cc:49:19: error: 'endl' was not declared in this scope
   49 |           cout << endl;
      |                   ^~~~
Language: C++

#include <iostream>

#define MAX_SET (1000)

using namespace std;

void draw_chessboard(int H, int W);

int main()
{  
    int  i;
    int* H = new int[MAX_SET + 1];
    int* W = new int[MAX_SET + 1];
    int  size;

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> H[i] >> W[i];
         } while (H[i] > 300 || W[i] > 300);

         if (H[i] == 0 && W[i] == 0) {	    
             size = i;
	     break;
         }
    }
    
    for (int i = 0; i < size; i++) {
         draw_chessboard(H[i], W[i]) {     
         cout << endl;         
    }

    delete[] H;
    delete[] W;
 
    return (0);
} 

void draw_chessboard(int H, int W)
{    
     for (int i = 1; i <= H; i++) {
          if (i % 2 == 1) {
              for (int j = 1; j <= W; j++) {
	   	   if (j % 2 == 1) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
              }
          } else {
	      for (int j = 1; j <= W; j++) {
		   if (j % 2 == 0) {
		       cout << "#";
                   } else {
		       cout << "."
                   }
	      }
          }

          cout << endl;
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected ';' before '{' token
   28 |          draw_chessboard(H[i], W[i]) {
      |                                     ^~
      |                                     ;
a.cc:39:1: error: a function-definition is not allowed here before '{' token
   39 | {
      | ^
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
Language: C++

#include <iostream>

#define MAX_SET (1000)

using namespace std;

void draw_chessboard(int H, int W);

int main()
{  
    int  i;
    int* H = new int[MAX_SET + 1];
    int* W = new int[MAX_SET + 1];
    int  size;

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> H[i] >> W[i];
         } while (H[i] > 300 || W[i] > 300);

         if (H[i] == 0 && W[i] == 0) {	    
             size = i;
	     break;
         }
    }
    
    for (int i = 0; i < size; i++) {
         draw_chessboard(H[i], W[i]) {     
         cout << endl;         
    }

    delete[] H;
    delete[] W;
 
    return (0);
} 

void draw_chessboard(int H, int W)
{    
     for (int i = 1; i <= H; i++) {
          if (i % 2 == 1) {
              for (int j = 1; j <= W; j++) {
	   	   if (j % 2 == 1) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
              }
          } else {
	      for (int j = 1; j <= W; j++) {
		   if (j % 2 == 0) {
		       cout << "#";
                   } else {
		       cout << ".";
                   }
	      }
          }

          cout << endl;
     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected ';' before '{' token
   28 |          draw_chessboard(H[i], W[i]) {
      |                                     ^~
      |                                     ;
a.cc:39:1: error: a function-definition is not allowed here before '{' token
   39 | {
      | ^
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
Language: C++

#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)out<<".";
}
cout<<endl;
}
cout<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'out' was not declared in this scope
   12 | else if((i+h)%2==1)out<<".";
      |                    ^~~
Language: C++

#include<iostream>
#include<cstdio>

void printLine(int b, char a, char b)
{
  for(int j = 0;  j < b ; j++) {
  if (j % 2 == 0 ) 
  printf("%c", a);
  else
  printf("$c", b);
  }
  printf("\n");
}


int main()
{
  int a, b;
  while(std::cin >> a >> b, a + b != 0 ){
  for(int i = 0 ; i < a;  i++) {
  if (i % 2 == 0)
   printLine(b, '#', '.');
   continue;
  }
   printLine(b, '.', '#');

  }
  printf("\n");}
}

Compiler output:
a.cc:4:36: error: conflicting declaration 'char b'
    4 | void printLine(int b, char a, char b)
      |                               ~~~~~^
a.cc:4:20: note: previous declaration as 'int b'
    4 | void printLine(int b, char a, char b)
      |                ~~~~^
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
#include<cstdio>

void printLine(int l, char a, char b)
{
  for(int j = 0;  j < l ; j++) {
  if (j % 2 == 0 ) 
  printf("%c", a);
  else
  printf("$c", b);
  }
  printf("\n");
}


int main()
{
  int a, b;
  while(std::cin >> a >> b, a + b != 0 ){
  for(int i = 0 ; i < a;  i++) {
  if (i % 2 == 0)
   printLine(b, '#', '.');
   continue;
  }
   printLine(b, '.', '#');

  }
  printf("\n");}
}

Compiler output:
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected '}' at end of input
   20 | return 0;
      |          ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    print("\n".join(["".join(["." if (h + w) & 1 else "#" for w in range(W)]) for h in range(H)])+"\n")

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

//---- Print a Chessboard
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");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d %d", &H, &W);
      |         ^~~~~
a.cc:10:21: error: 'printf' was not declared in this scope
   10 |                     printf("#");
      |                     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | //---- Print a Chessboard
a.cc:13:21: error: 'printf' was not declared in this scope
   13 |                     printf(".");
      |                     ^~~~~~
a.cc:13:21: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:16:13: error: 'printf' was not declared in this scope
   16 |             printf("\n");
      |             ^~~~~~
a.cc:16:13: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("\n");
      |         ^~~~~~
a.cc:18:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<iostream>
using namespace std;

int main(){
 while(1){
  int h,w;
  cin >> h >> w;
  if(h==0&&w==0) break;

  for(i=1;i<=h;++i){
   for(j=1;j<=w;++j){
    if((i+j)%2==0) cout << "#";
    else cout << ".";
   }
   cout << endl;
  }
  cout << endl;
 }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=1;i<=h;++i){
      |       ^
a.cc:11:8: error: 'j' was not declared in this scope
   11 |    for(j=1;j<=w;++j){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
intmain(){
	int h,w,i,j;
	cin>>h>>w;
	for(i=0;i<h;i++){
		if(i%2==0){
			for(j=0;j<w;j++){
				cout<<"#";
				j++;
				cout<<".";
			}
			cout<<"\n";
		}
		else{
			for(j=0;j<w;j++){
				cout<<".";
				j++;
				cout<<"#";
			}
			cout<<"\n";
		}
	}
	return 0;
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
    3 | intmain(){
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	int i, j,x,H,W;
	for (;;){
		cin >> H >> W;
		if (H == 0 && W == 0)break;
			for (j = 1; i == H; j++){

				x = i + j;
				if (x % 2 == 0){
						cout << ".";
				}
				if (x % 2 != 0){
						cout << "#";
				}
				if (j == W){
					cout << endl;
					i++;

				}
			}
	}





	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected '}' at end of input
   29 |         return 0;
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

	int W;
	for (;;){
		cin >> H >> W;
		if (H == 0 && W == 0){
			return 0;
		}else{for (int b = 0; b < H; b++){
				if (b % 2 == 0){
					for (int c = 0; c < W; c++){
						if (c % 2 == 0){
							cout << "#";
						}
						else{
							cout << ".";
						}
					}cout << endl;
				}
				else{
					for (int c = 0; c < W; c++){
						if (c % 2 == 0){
							cout << ".";
						}
						else{
							cout << "#";
						}
					}cout << endl;
				}
			}cout << endl;
		}

	}
}

Compiler output:
a.cc:2:9: error: expected unqualified-id before 'for'
    2 |         for (;;){
      |         ^~~
a.cc:2:16: error: expected unqualified-id before ')' token
    2 |         for (;;){
      |                ^
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int i, j,x,H,W;
	for (;;){
		cin >> H >> W;
		if (H == 0 && W == 0)break;
			for (j = 1; i == H; j++){

				x = i + j;
				if (x % 2 == 0){
						cout << ".";
				}
				if (x % 2 != 0){
						cout << "#";
				}
				if (j == W){
					cout << endl;
					i++;
			}
	}





	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int i, j,x,H,W;
	for (;;){
		cin >> H >> W;
		if (H == 0 && W == 0)break;
			for (j = 1; i == H; j++){

				x = i + j;
				if (x % 2 == 0){
						cout << ".";
				}
				if (x % 2 != 0){
						cout << "#";
				}
				if (j == W){
					cout << endl;
					i++;
			}
	}





	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
int H,W;

while(1)
{
cin >> H >> W;

if(cin >> 0 >> 0)
break;

for(int i=0;i<H;i++)
{
for(int j=0;j<W;j++)
{
if((j+i)%2==0)
cout << "#";
else
cout << ".";
}
cout << endl;
} 
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: ambiguous overload for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
   12 | if(cin >> 0 >> 0)
      |    ~~~ ^~ ~
      |    |      |
      |    |      int
      |    std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
  122 |       operator>>(__istream_type& (*__pf)(__istream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
  126 |       operator>>(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
  133 |       operator>>(ios_base& (*__pf)(ios_base&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
  352 |       operator>>(__streambuf_type* __sb);
      |       ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*) [with _Traits = char_traits<char>]'
  939 |     operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
      |     ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*) [with _Traits = char_traits<char>]'
  945 |     operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
      |     ^~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
int H,W;

while(cin >> 0 >> 0;)
{
cin >> H >> W;

for(int i=0;i<H;i++)
{
for(int j=0;j<W;j++)
{
if((j+i)%2==0)
cout << "#";
else
cout << ".";
}
cout << endl;
} 
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: ambiguous overload for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
    8 | while(cin >> 0 >> 0;)
      |       ~~~ ^~ ~
      |       |      |
      |       |      int
      |       std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
  122 |       operator>>(__istream_type& (*__pf)(__istream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
  126 |       operator>>(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
  133 |       operator>>(ios_base& (*__pf)(ios_base&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
  352 |       operator>>(__streambuf_type* __sb);
      |       ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*) [with _Traits = char_traits<char>]'
  939 |     operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
      |     ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*) [with _Traits = char_traits<char>]'
  945 |     operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
      |     ^~~~~~~~
a.cc:8:20: error: expected ')' before ';' token
    8 | while(cin >> 0 >> 0;)
      |      ~             ^
      |                    )
a.cc:8:21: error: expected primary-expression before ')' token
    8 | while(cin >> 0 >> 0;)
      |                     ^
Language: C++

#include <cstdio>                                                                                                                                                         #include <iostream>                                                                                                                                                       
                                                                                                                                                                          
using namespace std;                                                                                                                                                      
                                                                                                                                                                          int main() {                                                                                                                                                                int H, W;
  for (;;) {
    cin >> H >> W;
    if (!H && !W)
      break;

    for (int i = 0; i < H; ++i) {
      const char c = i % 2 == 0 ? '#' : '.';
      const char d = c == '#' ? '.' : '#';
      for (int j = 0; j < W; ++j) {
        if (j % 2 == 1)
          printf("%c", d);
        else
          printf("%c", c);
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}

Compiler output:
a.cc:1:171: warning: extra tokens at end of #include directive
    1 | #include <cstdio>                                                                                                                                                         #include <iostream>
      |                                                                                                                                                                           ^
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> H >> W;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>                                                                                                                                                         #include <iostream>
  +++ |+#include <iostream>
    2 |
Language: C++

figure = ''
height, width = [int(x) for x in input().split()]
while height or width:
    pattern = '#.' * (((height+width)//2) + 1)
    for h in range(height):
            figure += pattern[h : width + h] + '\n'
    figure += '\n'
    height, width = [int(x) for x in input().split()]

print(figure[:-1])

Compiler output:
a.cc:1:10: error: empty character constant
    1 | figure = ''
      |          ^~
a.cc:4:15: warning: multi-character character constant [-Wmultichar]
    4 |     pattern = '#.' * (((height+width)//2) + 1)
      |               ^~~~
a.cc:1:1: error: 'figure' does not name a type
    1 | figure = ''
      | ^~~~~~
Language: C++

#include <stdio.h>
int main(){
    int H,W,i,j;
    
    while(scanf("%d%d",&H,&W),a|b){    
        for(i=0;i<H;i++){
            for(j=0;j<W;j++) printf("%c",(i+j)%2?'#':'.');
            printf("\n");    
        }
    printf("\n");       
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:31: error: 'a' was not declared in this scope
    5 |     while(scanf("%d%d",&H,&W),a|b){
      |                               ^
a.cc:5:33: error: 'b' was not declared in this scope
    5 |     while(scanf("%d%d",&H,&W),a|b){
      |                                 ^
Language: C++

#include <bits/stdc++.h>
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 %= 0){
                    cout << ".";
                }else{
                    cout << "#";
                }
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: warning: division by zero [-Wdiv-by-zero]
   12 |                 if(i + j %= 0){
      |                    ~~~~~~^~~~
a.cc:12:22: error: lvalue required as left operand of assignment
   12 |                 if(i + j %= 0){
      |                    ~~^~~
Language: C++

#include <bits/stdc++.h>
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 %= 0){
                    cout << "#";
                }else{
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: warning: division by zero [-Wdiv-by-zero]
   12 |                 if(i + j %= 0){
      |                    ~~~~~~^~~~
a.cc:12:22: error: lvalue required as left operand of assignment
   12 |                 if(i + j %= 0){
      |                    ~~^~~
Language: C++

#include <bits/stdc++.h>
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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: lvalue required as left operand of assignment
   12 |                 if((i + j) % 2 = 0){
      |                    ~~~~~~~~^~~
Language: C++

#include<stdio.h>
int main(){
	int H,W;
	while(1){
		scanf("%d %d",&H,&W);
		if(H==0&&W==0) break;
		for(int j=1;j<=H;j++){
			for(int i=1;i<=W;i++){
				if((j%2)==1){
					if((i%2)==1)	printf("#");
					else((i%2)==0)	printf(".");
				}
				else{
					if((i%2)==1)	printf(".");
					else((i%2)==0)	printf("#");
					
				}
			}
			printf("\n");
		}
		printf("\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:56: error: expected ';' before 'printf'
   11 |                                         else((i%2)==0)  printf(".");
      |                                                       ^~~~~~~~
      |                                                        ;
a.cc:15:56: error: expected ';' before 'printf'
   15 |                                         else((i%2)==0)  printf("#");
      |                                                       ^~~~~~~~
      |                                                        ;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
using namespace std;
#define C


#ifdef C
int main(void)
{
	int H, W;
	vector<pair<int, int> > arr;
	while (true)
	{
		cin >> H >> W;
		if (H == 0 && W == 0) break;
		arr.push_back(pair<int, int>(H, W));

	}
	for (auto a : arr) {
		for (size_t i = 0; i < a.first; i++)
		{
			bool f = (i % 2 == 0) ? true : false;
			for (size_t j = 0; j < a.second; j++)
			{
				if (f)
					cout << "#";
				else
					cout << ".";
				f = !f;
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:9: error: unterminated #ifdef
    9 | #ifdef C
Language: C++

#include <stdio.h>

int main(){
  int W,H,x,y,z,h,w;
  scanf("%d %d",&W,&H);
  for(;;){
  if(W==0 && H==0){
      return 0;
    }
  h=H/2
  w=W/2
  for(y=0;y<h;y++){
    for(x=0;x<w;x++){
      printf("#.");
    }
    printf("\n");
    for(z=0;z<w;z++){
      printf(".#");
    }
    printf("\n");
  }
  printf("\n");
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before 'w'
   10 |   h=H/2
      |        ^
      |        ;
   11 |   w=W/2
      |   ~     
a.cc:12:18: error: expected ';' before ')' token
   12 |   for(y=0;y<h;y++){
      |                  ^
      |                  ;
Language: C++

#include <stdio.h>
int H,W,i,j;
int main(){
  for(;;){
    scanf("%d %d",&H,&W);
    if(H==0&&W==0){
      return 0;
    }
    for(i=0;i<H;i++){
      for(j=0;j<w;j++){
        if(i%2==0&&j%2==0){
          printf("#");
        } else if(i%2==0&&j%2==1){
          printf(".");
        } else if(i%2==1&&j%2==0){
          printf(".");
        } else if(i%2==1&&j%2==1){
          printf("#");
        }
      }
      printf("\n");
    }
    printf("\n");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'w' was not declared in this scope
   10 |       for(j=0;j<w;j++){
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int main{
	int i,j,H,W;
	char inic,midc;
	while(1)
	{
		inic = "o";
		midc = "o";
		cin >> H >>W;
		if ((H==0) && (W==0)) break;
		for (i=0;i<H;i++)
		{
			switch(inic){
			  case "o":
				inic = "#";
				break;
			  case "#":
				inic = ".";
				break;
			  case ".":
				inic = "#";
				break;
			}
			cout << inic;
			midc = inic;
			for (j=0; j<W; j++)
			{
				switch(midc){
				  case "#":
					midc = ".";
					break;
				  case ".":
					midc = "#";
					break;
				}
				cout << midc;
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |         int i,j,H,W;
      |         ^~~
a.cc:4:9: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:9: error: expected unqualified-id before 'while'
    6 |         while(1)
      |         ^~~~~
a.cc:43:9: error: expected unqualified-id before 'return'
   43 |         return 0;
      |         ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;


int main()
{
	int H,W;
	int i,j;
	do{
		cin>>H>>W;
		for(i=0;i<H;i++){

			for(j=0;j<W;j++){
				if((i+j)%2==0){
					cout<<"#";
				}
				else cout<<".";
			
			
		}
			cout<<endl;
		}

	}while(H!=0||W!=0);

	

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected '}' at end of input
   29 |         return 0;
      |                  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
using namespace std;


int main()
{
	int H,W;
	int i,j;
	do{
		cin>>H>>W;
		for(i=0;i<H;i++){

			for(j=0;j<W;j++){
				if((i+j)%2==0){
					cout<<"#";
				}
				else cout<<".";
			
			
		}
			cout<<endl;
		}

	}while(H!=0||W!=0);

	

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expected '}' at end of input
   28 |         return 0;
      |                  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#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 (j % 2 == 0) {
					if (j % 2 == 0) {
						std::cout << "#";
					}
					else {
						std::cout << ".";
					}
				}
		else{
			if (j % 2 == 0) {
				std::cout << ".";
			}
			else {
				std::cout << "#";
			}
		}
		if (j== W - 1) {
			std::cout << std::endl;
		}
		}
		std::cout << std::endl;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <string>
using namespace std;

int main()
{
  int H, W;

  while( 1 ) {
    cin >> H >> W;
    if( H == 0 and W == 0 ) {
      break;
    }

    string buf1 = "";
    string buf2 = "";
    for( int i = 0; i < W; i++ ) {
      if( i % 2 == 0 ) {
        buf1 += "#";
        buf2 += ".";
      }
      else {
        buf1 += ".";
        buf2 += "#";
      }
    }

    for( int j = 0; j < H; j++ ) {
      if( j % 2 == 0 ) {
        cout << buf1 << endl;
      }
      else {
        cout << buf2 << endl;
      }
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> H >> W;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:29:9: error: 'cout' was not declared in this scope
   29 |         cout << buf1 << endl;
      |         ^~~~
a.cc:29:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:25: error: 'endl' was not declared in this scope
   29 |         cout << buf1 << endl;
      |                         ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout << buf2 << endl;
      |         ^~~~
a.cc:32:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:25: error: 'endl' was not declared in this scope
   32 |         cout << buf2 << endl;
      |                         ^~~~
a.cc:32:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:5: error: 'cout' was not declared in this scope
   35 |     cout << endl;
      |     ^~~~
a.cc:35:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:13: error: 'endl' was not declared in this scope
   35 |     cout << endl;
      |             ^~~~
a.cc:35:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'