I'm trying to write a function that finds winner status of tictactoe. But, I have an mistake I can't find it. When i paste input values by console, it closes the terminal and doesn't take last part of inputs(O X O). Could you tell me where my wrong is ? Thank you for all appreciated answers.
Example in put is:

```
3
X
X O X
X X X
O X O

```

---

```
#include <stdio.h>

char result(char board[][3]);
void test_part1();

int main(){

    test_part1();

    return 0;
}
char result(char board[][3]){

    char winner = 'T';
    int i;

// Checks for:
//     X X X
    for (i = 0; i < 3; i++)
            if (//bla bla)
        return winner;
        }

// Checks for:
// X
// X
// X
    for (i = 0; i < 3; i++)
                if (//bla bla)
                return winner;
        }

// Checks for:
// X                 X
//   X      or     X
//     X         X
    if (//bla bla)
            return winner;
        }
            return winner;
}
void test_part1(){

    int size;
    char ch;
    int i,j;
    char tictac[3][3];

    scanf("%d",&size);
        if(size==3){
    scanf("%c",&ch);
    for(i=0;i<size;i++)
    for(j=0;j<size;j++)
        scanf("%c",&tictac[i][j]);
    if(ch==(result(tictac)))
        printf("Win\n");
    else if('T'==(result(tictac)))
        printf("Draw\n");
    else
        printf("Lost\n");
    }
    else{
        printf("Size is must be 3\n");
        return;
    }

}

```