Language: C

        
scanf("%c", &temp2);
        for (int j = 0; j < W; j++) {
            char temp;
            scanf("%c", &temp);
            if (temp == '.') {
                //printf(".");
                board[i][j] = 0;
            }
            else if (temp == '#') {
                //printf("#");
                board[i][j] = 1;
                skipflag = 0;
            }
            else if (temp == '\n') {
                printf("invalid\n");
                return 1;
            }
        }
        //scanf("%c", &temp2);
        if (skipflag == 1) {
            skipH[i] = 1;
        }
    }   
    for (int j = 0; j < W; j++) {
        int skipflag = 1;
        for (int i = 0; i < H; i++) {
            if (board[i][j] == 0) {
                continue;
            }   
            else {
                skipflag = 0;
            }   
        }
        if (skipflag == 1) {
            skipW[j] = 1;
        }
    }
    for (int i = 0; i < H; i++) {
        if (skipH[i] == 0) {
            for (int j = 0; j < W; j++) {
                if (skipW[j] == 0) {
                    if (board[i][j] == 0){ 
                        printf(".");
                    }   
                    else {
                        printf("#");
                    }
                }
                else {
                    continue;
                }
            }
            printf("\n");
        }
        else {
            continue;
        }
    }   
}


Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%c", &temp2);
      |       ^~~~
main.c:2:13: error: expected declaration specifiers or '...' before '&' token
    2 | scanf("%c", &temp2);
      |             ^
main.c:3:9: error: expected identifier or '(' before 'for'
    3 |         for (int j = 0; j < W; j++) {
      |         ^~~
main.c:3:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |         for (int j = 0; j < W; j++) {
      |                           ^
main.c:3:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |         for (int j = 0; j < W; j++) {
      |                                 ^~
main.c:21:9: error: expected identifier or '(' before 'if'
   21 |         if (skipflag == 1) {
      |         ^~
main.c:24:5: error: expected identifier or '(' before '}' token
   24 |     }
      |     ^
main.c:25:5: error: expected identifier or '(' before 'for'
   25 |     for (int j = 0; j < W; j++) {
      |     ^~~
main.c:25:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   25 |     for (int j = 0; j < W; j++) {
      |                       ^
main.c:25:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   25 |     for (int j = 0; j < W; j++) {
      |                             ^~
main.c:39:5: error: expected identifier or '(' before 'for'
   39 |     for (int i = 0; i < H; i++) {
      |     ^~~
main.c:39:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   39 |     for (int i = 0; i < H; i++) {
      |                       ^
main.c:39:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   39 |     for (int i = 0; i < H; i++) {
      |                             ^~
main.c:60:1: error: expected identifier or '(' before '}' token
   60 | }
      | ^