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

int main()
{
  int h,w;
  int i,j;
  scanf("%d",&h);
  scanf("%d",&w);
  while(!((h==0) && (w==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");
    scanf("%d",&h);
    scanf("%d",&w);
  }
 
 
  return 0;

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&h);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&h);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:11: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |           printf("#");
      |           ^~~~~~
main.c:11:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:11: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:11: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |           printf(".");
      |           ^~~~~~
main.c:13:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:11: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   15 |           printf(".");
      |           ^~~~~~
main.c:15:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:11: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |           printf("#");
      |           ^~~~~~
main.c:17:11: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |       printf("\n");
      |       ^~~~~~
main.c:20:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   22 |     printf("\n");
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:3: error: expected declaration or statement at end of input
   28 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>

int main(void){
    int H,W,i,j,k,l;
    while(1){
    scanf("%d %d",&H,&W);
    if(H==0 && W==0)break;
    if(H%2 == 0 && W%2 == 0){
        for(i=0;i<H/2;i++){
            for(j=0;j<W/2;j++){
                printf("#.");              
            }
            printf("\n");
            for(k=0;k<W/2;k++){
                printf(".#");
            }
            printf("\n");
        }
        printf("\n");
     }
    if(H%2 == 0 && W%2 == 1){
        for(i=0;i<H/2;i++){
            for(j=0;j<(W-1)/2;j++){
                printf("#.");
            }
                printf("#\n");
            for(k=0;k<(W-1)/2;k++){
                printf(".#");
            }
                printf(".\n");
        }
        printf("\n\");
    }
    if(H%2 == 1 && W%2 == 0){
         for(i=0;i<(H-1)/2;i++){
            for(j=0;j<W/2;j++){
                printf("#.");
            }
                printf("\n");
            for(k=0;k<W/2;k++){
                printf(".#");
            }
                printf("\n");
        }
        for(l=0;l<W/2;l++){
            printf("#.");
        }
        printf("\n\n");
    }
    if(H%2 == 1 && W%2 == 1){
        if(H==0 && W==0)printf("#");
         for(i=0;i<(H-1)/2;i++){
            for(j=0;j<(W-1)/2;j++){
                printf("#.");
            }
                printf("#\n");
            for(k=0;k<(W-1)/2;k++){
                printf(".#");
            }
                printf(".\n");
         }
        for(l=0;l<(W-1)/2;l++){
            printf("#.");
        }
        printf("#\n\n");
    }
    }
     return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:32:16: warning: missing terminating " character
   32 |         printf("\n\");
      |                ^
main.c:32:16: error: missing terminating " character
   32 |         printf("\n\");
      |                ^~~~~~~
main.c:33:5: error: expected expression before '}' token
   33 |     }
      |     ^
main.c:32:16: error: expected ';' before '}' token
   32 |         printf("\n\");
      |                ^
      |                ;
   33 |     }
      |     ~
Language: C

#include <stdio.h>

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

			}
			printf("\n");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:35: error: 'G' undeclared (first use in this function)
    8 |                 scanf("%d %d",&H,&G);
      |                                   ^
main.c:8:35: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:30: error: expected ';' before '}' token
   11 |                         break
      |                              ^
      |                              ;
   12 |                 }
      |                 ~
Language: C

#include <stdio.h>

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

			}
			printf("\n");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:35: error: 'G' undeclared (first use in this function)
    8 |                 scanf("%d %d",&H,&G);
      |                                   ^
main.c:8:35: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
int H,W,i,j;
while(1){
   scanf("%d %d",&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){
            printf("#");
         }else{
            printf(".");
         }
      }
      printf("\n");
   }
   printf("\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:20: error: expected ';' before ')' token
    8 |    for(i=1,i<=H,i++){
      |                    ^
      |                    ;
main.c:8:20: error: expected expression before ')' token
main.c:9:23: error: expected ';' before ')' token
    9 |       for(j=1,j<=W,j++){
      |                       ^
      |                       ;
main.c:9:23: error: expected expression before ')' token
Language: C

int main(void) {
	int h=1,w=1;

	while (h != 0 && w != 0) {
		scanf("%d %d", &h, &w);

		if (h % 2) {
			while (h--) {
				if (h % 2) { m(w); }
				else ms(w);
				printf("\n");
			}
		}
		else {
			while (h--) {
				if (h % 2) { ms(w); }
				else m(w);
				printf("\n");
			}
			
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |                 scanf("%d %d", &h, &w);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void) {
main.c:5:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |                 scanf("%d %d", &h, &w);
      |                 ^~~~~
main.c:5:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:46: error: implicit declaration of function 'm' [-Wimplicit-function-declaration]
    9 |                                 if (h % 2) { m(w); }
      |                                              ^
main.c:10:38: error: implicit declaration of function 'ms' [-Wimplicit-function-declaration]
   10 |                                 else ms(w);
      |                                      ^~
main.c:11:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |                                 printf("\n");
      |                                 ^~~~~~
main.c:11:33: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:33: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |                                 printf("\n");
      |                                 ^~~~~~
main.c:18:33: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   22 |                 printf("\n");
      |                 ^~~~~~
main.c:22:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:9: error: expected expression before '||' token
   10 | if(i==0)||(i==H -1)){
      |         ^~
main.c:10:20: error: expected statement before ')' token
   10 | if(i==0)||(i==H -1)){
      |                    ^
main.c:14:2: error: 'else' without a previous 'if'
   14 | }else{
      |  ^~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:9: error: expected expression before '||' token
   10 | if(i==0)||(i==H-1)){
      |         ^~
main.c:10:19: error: expected statement before ')' token
   10 | if(i==0)||(i==H-1)){
      |                   ^
main.c:14:2: error: 'else' without a previous 'if'
   14 | }else{
      |  ^~~~
Language: C

#include <stdio.h>


int main(void)
{
	int h[300];
	int w[300];
	int i = -1,j,k,l;
	do{
		i++;
		scanf("%d%d", &h[i], &w[i]);
	} while (h[i] != 0 || w[i] != 0);
	for (j = 0; j <= i; j++){
		for (l = 0; l < h[j]; l++){
			for (k = 0; k < w[j]; k++) {
				if(l % 2 == 1 && k % 2 == 1)printf("#");
                                else if(l % 2 == 0 && K % 2 == 0)printf("#");
				else printf(".");
			}
			printf("\n");
		}
		if(j != i)printf("\n");
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:55: error: 'K' undeclared (first use in this function)
   17 |                                 else if(l % 2 == 0 && K % 2 == 0)printf("#");
      |                                                       ^
main.c:17:55: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void) {
	int n, m, i, k;
	while (1) {
		scanf("%d %d", &n, &m);
		if (n == 0 && m == 0) break;
		for (i = 0; i < n; i++) {
			for (k = 0; k < m; k++) {
				if ((i + k) % 2 == 0) printf("#");
				else printf(".");
			}
			printf("\n");
		}
	}
	printf("\n")
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:21: error: expected ';' before 'return'
   16 |         printf("\n")
      |                     ^
      |                     ;
   17 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>
int main(void){
        int h,w,hc,wc,c;
        while(1){
	 scanf("%d %d",&h,&w);
         if(h==0 && w==0){
          break;
         }
         c=0
	 for(hc=1;hc<=h;hc++){
 	        for(wc=1;wc<=w;wc++){
	 	        if(c==0){
                                printf("#");
                                c=1;
                        }else{
                                printf(".");
                                c=0;
                        }
                 }
                 printf("\n");
	 }
        printf("\n");
        }
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:13: error: expected ';' before 'for'
    9 |          c=0
      |             ^
      |             ;
   10 |          for(hc=1;hc<=h;hc++){
      |          ~~~
Language: C

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




Compiler output:
main.c: In function 'main':
main.c:8:30: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    8 |         if (H == 0 && W ==0) exit(0);
      |                              ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:30: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    8 |         if (H == 0 && W ==0) exit(0);
      |                              ^~~~
main.c:8:30: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:13:21: error: expected expression before '.' token
   13 |                 else.      printf(".");
      |                     ^
Language: C

#include<stdio.h>
int main(){
    int H, W;    /* 幅、高さの格納用変数*/
    int i, j;    /* カウンタ用変数*/
    /* 無限ループ */
    while(1){
        /* 高さ、幅の入力 */
        scanf("%d %d", &H, &W);
        /* 終了条件の確認 */
        if(H == 0 && W == 0){
            break;
        }
        /* 長方形の出力 */
        for(i = 1;i <= H;i++){
　　　　　　/*  */
            for(j = 1;j <= W;j++){
　　　　　　　　/*  */
                if(i % 2 != j %2){
                    /* "#"の出力 */
                    printf("#");
                }
                else{
                    /* "."の出力 */
                    printf(".");
                }
            }
            /* 最終列の出力 */
            printf("\n");
        }
        /* 改行 */
        printf("\n");
    }
    /* 0を返す */
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      | ^~~~~~~~
main.c:15:3: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |         ^~~~~~~~
main.c:15:5: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                 ^~~~~~~~
main.c:15:7: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                         ^~~~~~~~
main.c:15:9: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                 ^~~~~~~~
main.c:15:11: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                         ^~~~~~~~
main.c:17:1: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      | ^~~~~~~~
main.c:17:3: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |         ^~~~~~~~
main.c:17:5: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                 ^~~~~~~~
main.c:17:7: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                         ^~~~~~~~
main.c:17:9: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                 ^~~~~~~~
main.c:17:11: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                         ^~~~~~~~
main.c:17:13: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                                 ^~~~~~~~
main.c:17:15: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                                         ^~~~~~~~
Language: C

#include<stdio.h>
int main(){
    int H, W;    /* 幅、高さの格納用変数*/
    int i, j;    /* カウンタ用変数*/
    /* 無限ループ */
    while(1){
        /* 高さ、幅の入力 */
        scanf("%d %d", &H, &W);
        /* 終了条件の確認 */
        if(H == 0 && W == 0){
            break;
        }
        /* 長方形の出力 */
        for(i = 1;i <= H;i++){
　　　　　　/*  */
            for(j = 1;j <= W;j++){
　　　　　　　　/*  */
                if(i % 2 != j % 2){
                    /* "#"の出力 */
                    printf("#");
                }
                else{
                    /* "."の出力 */
                    printf(".");
                }
            }
            /* 最終列の出力 */
            printf("\n");
        }
        /* 改行 */
        printf("\n");
    }
    /* 0を返す */
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      | ^~~~~~~~
main.c:15:3: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |         ^~~~~~~~
main.c:15:5: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                 ^~~~~~~~
main.c:15:7: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                         ^~~~~~~~
main.c:15:9: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                 ^~~~~~~~
main.c:15:11: error: stray '\343' in program
   15 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                         ^~~~~~~~
main.c:17:1: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      | ^~~~~~~~
main.c:17:3: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |         ^~~~~~~~
main.c:17:5: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                 ^~~~~~~~
main.c:17:7: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                         ^~~~~~~~
main.c:17:9: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                 ^~~~~~~~
main.c:17:11: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                         ^~~~~~~~
main.c:17:13: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                                 ^~~~~~~~
main.c:17:15: error: stray '\343' in program
   17 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>/*  */
      |                                                         ^~~~~~~~
Language: C

#include <stdio.h>

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




Compiler output:
main.c: In function 'main':
main.c:13:38: error: expected ')' before '{' token
   13 |                 if(((i + n) % 2 == 1){
      |                   ~                  ^
      |                                      )
main.c:18:13: error: expected expression before '}' token
   18 |             }
      |             ^
Language: C

#include<stdio.h>

main() {
	int H[1000], W[1000],i,kkn=0,j,k;
	for (i = 0;i < 10000;i++) {
		scanf("%d %d", &H[i], &W[i]);
		if (H[i] == 0 && W[i] == 0) break;
		kkn++;

	}
	for (i = 0;i < kkn;i++) {
		for (j = 0;j < H[i];j++) {
			if (j % 2 != 0) {
				for (k = 0;k < W[i];k++) {
					if (k % 2 == 0) {
						putchar('.');
					}
					else {
						putchar('#');
					}
				}
			}
			else {
				for (k = 0;k < W[i];k++) {
					if (k % 2 == 0) {
						putchar('#');
					}
					else {
						putchar('.');
					}
				}
			}

		}
		printf("\n");
		
	
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main() {
      | ^~~~
main.c: In function 'main':
main.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
Language: C

#include<stdio.h>
int main(void)
{
	int h, w, H, W;

	while (1) {
		scanf("%d %d", &H, &W);
		for (h = 1; h <= H; h++)
		{
			if (H % 2 != 0) {
				for (w = 1; w <= (W / 2); w++) {
					printf("#.");
				}
			}
			else {
				for (w = 1; w <= (W / 2); w++) {
					printf("#.");
				}
			}
			printf("\n");
		}
		if (H == 0 && W == 0) break;
		printf("\n");
	}
	return 0;


Compiler output:
main.c: In function 'main':
main.c:25:9: error: expected declaration or statement at end of input
   25 |         return 0;
      |         ^~~~~~
Language: C

#include<stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:17:45: error: lvalue required as left operand of assignment
   17 |                                 if( (h+w)%2 = 0; )
      |                                             ^
main.c:17:48: error: expected ')' before ';' token
   17 |                                 if( (h+w)%2 = 0; )
      |                                   ~            ^
      |                                                )
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(j=1;j<=H;j++){
      for(i=1;i<=W;i++){
        if(j !% 2 && i !% 2){
          printf(".");
        } else if(j % 2 && i % 2){
          printf("#");
        }else if(j !% 2 && i % 2){
          printf(".");
        }else{
          printf("#");
        }
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:13: error: expected ')' before '!' token
   10 |         if(j !% 2 && i !% 2){
      |           ~ ^~
      |             )
main.c:14:19: error: expected ')' before '!' token
   14 |         }else if(j !% 2 && i % 2){
      |                 ~ ^~
      |                   )
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(j=1;j<=H;j++){
      for(i=1;i<=W;i++){
        if(j & 1 && i & 1){
          printf("#");
        }else {
          printf(".");
        } else if(j % 2 && i & 1){
          printf(".");
        } else if(j % 2 && i % 2){
            printf("#");
        }
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:11: error: 'else' without a previous 'if'
   14 |         } else if(j % 2 && i & 1){
      |           ^~~~
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(j=1;j<=H;j++){
      for(i=1;i<=W;i++){
        if(j & 1 && i & 1){
          printf("#");
        }else {
          printf(".");
        } 
        if(j % 2 && i & 1){
          printf(".");
        } else (j % 2 && i % 2){
            printf("#");
        }
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:32: error: expected ';' before '{' token
   17 |         } else (j % 2 && i % 2){
      |                                ^
      |                                ;
Language: C


#include <stdio.h> 
4 
 
 int main(){ 

     int h, w; 
     int i, j; 
     while(1){ 
         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%2==0&&j%2==0)||(i%2==1&&j%2==1)){ 
                     printf("#"); 
                 }else{ 
                     printf("."); 
                 } 
             } 
             printf("\n"); 
         } 
         printf("\n"); 
     } 
 
 
     return 0; 
 } 



Compiler output:
main.c:3:1: error: expected identifier or '(' before numeric constant
    3 | 4
      | ^
Language: C



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


Compile Error Logs: 

 

Status 
Judge: 4/4 C CPU: 00:00 sec Memory: 572 KB Length: 336 B 2015-04-13 19:41 
Results for testcases 
Case # Verdict CPU Time Memory In Out Case Name 

Case #1 : Accepted 00:00 572 8 3 testcase_00 
Case #2 : Accepted 00:00 572 12 20 testcase_01 
Case #3 : Accepted 00:00 572 89 821 testcase_02 
Case #4 : Accepted 00:00 572 68 52186 testcase_03 



 < prev |  /   | next >      

 

Judge Input #  (  | )  Judge Output #  (  | ) 


  

 



 



Compiler output:
main.c:3:20: warning: extra tokens at end of #include directive
    3 | #include <stdio.h> int main() { int H , W ,i,j; while(1){ scanf("%d %d",&H, &W); if(H == 0 && W == 0) { break; } for(j=1; j<=H; j++) { for(i=1; i<=W; i++) { if((i+j)%2 == 0 ) { printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return 0; }
      |                    ^~~
main.c:6:1: error: unknown type name 'Compile'
    6 | Compile Error Logs:
      | ^~~~~~~
main.c:6:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
    6 | Compile Error Logs:
      |               ^~~~
main.c:13:6: error: stray '#' in program
   13 | Case # Verdict CPU Time Memory In Out Case Name
      |      ^
main.c:15:6: error: stray '#' in program
   15 | Case #1 : Accepted 00:00 572 8 3 testcase_00
      |      ^
main.c:16:6: error: stray '#' in program
   16 | Case #2 : Accepted 00:00 572 12 20 testcase_01
      |      ^
main.c:17:6: error: stray '#' in program
   17 | Case #3 : Accepted 00:00 572 89 821 testcase_02
      |      ^
main.c:18:6: error: stray '#' in program
   18 | Case #4 : Accepted 00:00 572 68 52186 testcase_03
      |      ^
main.c:26:13: error: stray '#' in program
   26 | Judge Input #  (  | )  Judge Output #  (  | )
      |             ^
main.c:26:37: error: stray '#' in program
   26 | Judge Input #  (  | )  Judge Output #  (  | )
      |                                     ^
Language: C

#include <stdio.h>
int main(void)
{
    int h,w,i,j;
    while(1){
        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%2==0&&j%2==0)||(i%2==1&&j%2==1)){
                    printf("#");
                }else{
                    printf(".");
                }
            }
        printf("\n");
        }
        printf("\n");
    }
return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:28: error: expected ')' before '{' token
    9 |             for(j=0;j<w;j++{
      |                ~           ^
      |                            )
main.c:17:9: error: expected expression before '}' token
   17 |         }
      |         ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:17:21: error: expected '}' before 'else'
   17 |                     else{
      |                     ^~~~
Language: C

#include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	int H,W;
	while(true){
		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:
main.c:2:10: fatal error: algorithm: No such file or directory
    2 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void){
int H;
int W;
int a;
int i;
int j;
int c=0;
int ca;

scanf("%d %d",&H,&W);

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


Compiler output:
main.c: In function 'main':
main.c:20:11: error: expected ';' before 'if'
   20 |     ca=c+H
      |           ^
      |           ;
   21 |       if(ca%2=!1){
      |       ~~
Language: C

#include <stdio.h>
int main(void)
{
	int H;
	int W;
	int i, j,k=1;

	while (1) {
		scanf("%d", &H);
		scanf("%d", &W);

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


Compiler output:
main.c: In function 'main':
main.c:17:42: error: expected ')' before ';' token
   17 |                                 if (j = 0; j < W; j++) {
      |                                    ~     ^
      |                                          )
main.c:29:42: error: expected ')' before ';' token
   29 |                                 if (j = 0; j < W; j++) {
      |                                    ~     ^
      |                                          )
Language: C

#include <stdio.h>
 
int  main(void){
         int h,w,i,j;
          while(1){
          scanf("%d %d",&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)
              printf("#");
             else
              printf(".");
             }printf("\n");
            }printf("\n");
           }
            return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:21: error: 'J' undeclared (first use in this function)
   11 |               if((i+J)%2 == 0)
      |                     ^
main.c:11:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a = 1, b = 1, i = 1;
	while ((a != 0)||(b != 0)){
		if (i != 1)
			cout << endl;
		i++;
		cin >> a >> b;
		if ((a != 0)||(b != 0))
			for (int i = 1; i <= a; i++){
				for (int j = 1; j <= b; j++){
					if ((i % 2 == 0)&&(j % 2 == 1)
						cout << '#';
						else if ((i % 2 == 1)&&(j % 2 == 0)
							cout << '#';
							else cout << '.';
				}
				cout << endl;
			}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:71: error: expected ';' before 'cout'
   14 |                                         if ((i % 2 == 0)&&(j % 2 == 1)
      |                                                                       ^
      |                                                                       ;
   15 |                                                 cout << '#';
      |                                                 ~~~~                   
a.cc:16:49: error: expected primary-expression before 'else'
   16 |                                                 else if ((i % 2 == 1)&&(j % 2 == 0)
      |                                                 ^~~~
a.cc:15:61: error: expected ')' before 'else'
   15 |                                                 cout << '#';
      |                                                             ^
      |                                                             )
   16 |                                                 else if ((i % 2 == 1)&&(j % 2 == 0)
      |                                                 ~~~~         
a.cc:14:44: note: to match this '('
   14 |                                         if ((i % 2 == 0)&&(j % 2 == 1)
      |                                            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int H,W;
    while(1){
        cin >> H >> W;
        if(H==0&&W==0) break;
        for(i=1;H>=i;i++){
            for(j=1;W>=j;j++){
                if((i+j)%2==0){
                    cout << "#";                    
                }
                else cout << ".";;
                if(W==j) cout << endl;
            }
        }
    cout << endl;
    } 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
    9 |         for(i=1;H>=i;i++){
      |             ^
a.cc:10:17: error: 'j' was not declared in this scope
   10 |             for(j=1;W>=j;j++){
      |                 ^
Language: C++

#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%2==0&&j%2==0)||(i%2==1&&j%2==1))
      cout << "#";
    else cout << ".";
      }
      cout << endl;
    }
    cout << endl;
    cin >> h >> w;
  }
  return 0;



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

int main(void)
{
    int H=1, W=1, i, j;

    

    while ((H != 0) && (W != 0))
    {
        scanf("%d %d", &H, &W);

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

    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%d %d", &H, &W);
      |         ^~~~~
a.cc:23:25: error: 'printf' was not declared in this scope
   23 |                         printf("#");
      |                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:29:29: error: 'printf' was not declared in this scope
   29 |                             printf("#");
      |                             ^~~~~~
a.cc:29:29: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:33:29: error: 'printf' was not declared in this scope
   33 |                             printf(".");
      |                             ^~~~~~
a.cc:33:29: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:37:17: error: 'printf' was not declared in this scope
   37 |                 printf("\n");
      |                 ^~~~~~
a.cc:37:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:40:9: error: 'printf' was not declared in this scope
   40 |         printf("\n");
      |         ^~~~~~
a.cc:40:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:43:14: error: expected '}' at end of input
   43 |     return 0;
      |              ^
a.cc:2:1: note: to match this '{'
    2 | {
      | ^
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=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:13:25: error: expected ';' before '}' token
   13 |         else cout << '.'
      |                         ^
      |                         ;
   14 |       }
      |       ~
Language: C++

#include <iostream>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int H, W;

int main(){
	cin.tie(0);
	
	while(cin>>H>>W,H||W) {
	    rep(i, H) {
	        rep(j, W) {
	            cout<<((i+j)%2:'.':'#');
	        }
	        cout<<endl;
	    }
	    cout<<endl;
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:35: error: expected ')' before ':' token
   19 |                     cout<<((i+j)%2:'.':'#');
      |                           ~       ^
      |                                   )
Language: C++

#include<iostream>
using namespace std;

int main() {
	int w, h;
	while (1) {
		cin >> h >> w;
		if (w == 0 && h == 0)break;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {

				if ((i % 2 == 0 && j % 2 == 1) || (i % 2 == 1 && j % 2 == 0)) {
					cout << ".";
				}
				else if ((i % 2 == 0 && j % 2 == 0) || (i % 2 == 1 && j % 2 == 1)) 
					cout << "#";
				}

			}
			cout << endl;
		}
	}

}




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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:2:12: note: to match this '{'
    2 | int main (){
      |            ^
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*W; i++){
            if(i+1%W==0) cout << endl;
            if(i%2==0) cout << "#";
            else cout << ".";
        }
        cout << endl << endl;
        cin >> H >> W
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before 'return'
   14 |         cin >> H >> W
      |                      ^
      |                      ;
   15 |     return 0;
      |     ~~~~~~            
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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*W; i++){
            if(i+1%W==0) cout << endl;
            if(i%2==0) cout << "#";
            else cout << ".";
        }
        cout << endl << endl;
        cin >> H >> W
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before '}' token
   14 |         cin >> H >> W
      |                      ^
      |                      ;
   15 |     }
      |     ~
Language: C++

#include "pch.h"
#include <iostream>
using namespace std;
int main() {
	int a, b;
	for (;;) {
		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) { cout << '#'; }
			else { cout << '.'; }
		}
		cout << endl;
	}
}


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
using namespace std;


int main() {
	int H, W;
	bool flag = true;
	while (true) {
		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 (flag == true) {
				printf("#");
				flag = false;
			}
			else {
				printf(".");
				flag = true;
			}

		}
		if (H % 2 == 0) {
			if (flag == true) {
				flag = false;
			}
			else {
				flag = true;
			}
		}
		printf("\n");
	}
}







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

#include <iostream>

int main() {
    while( true ) {
        int h , w ;
        std::cin >> h >> w ;
        if( ! ( h | w ) ) {
            break ;
        } else {
            for( int i = 0 ; i < h ; i++ ) {
                for( int ii = 0 ; ii < w ; ii++ ) {
                    if( i % 2 == 0 ) {
                        if( ii % 2 == 0  ) {
                            std::cout << "#" ;
                        } else {
                            std::cout << "." ;
                        }
                    } else {
                        if( ii % 2 == 0 ) {
                            std::cout << "." ;
                        } else {
                            std:cout << "#" ;
                        }
                    }
                }
                std::cout << std::endl ;
            std::cout << std::endl ;
        }
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |                             std:cout << "#" ;
      |                                 ^~~~
      |                                 std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <iostream>

int main() {
    while( true ) {
        int h , w ;
        std::cin >> h >> w ;
        if( ! ( h | w ) ) {
            break ;
        } else {
            for( int i = 0 ; i < h ; i++ ) {
                for( int ii = 0 ; ii < w ; ii++ ) {
                    if( i % 2 == 0 ) {
                        if( ii % 2 == 0  ) {
                            std::cout << "#" ;
                        } else {
                            std::cout << "." ;
                        }
                    } else {
                        if( ii % 2 == 0 ) {
                            std::cout << "." ;
                        } else {
                            std::cout << "#" ;
                        }
                    }
                }
                std::cout << std::endl ;
            std::cout << std::endl ;
        }
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
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
        } else {
            for (int i = 0; i < h; i++) {
                if (i % 2 == 1) {
                    for (int j = 0; j < w / 2; j++) {
                        cout << "#.";
                        
                    }
                    if (w % 2 == 1) cout << "#";
                } else {
                    for (int j = 0; j < w / 2; j++) {
                        cout << ".#";
                        
                    }
                    if (w % 2 == 1) cout << ".";
                }
                cout << endl;
            }
            cout << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '}' token
    9 |             break
      |                  ^
      |                  ;
   10 |         } else {
      |         ~