아씽 제목에서 처리할려고 그랫더니 글자수 제한에 걸린듯요 ㅠ


void function(int matrix[][],int row,int column);


선언했더니 오류 떠서 matrix[]로 바꿧더니 계획한데로 굴러가지 않기 때문에 뒷부분에 오류가 낫지만 저부분은 돌아가데요...


원래 함수에는 행렬로 구성된 배열 입력 못하나요?


그런거 표현할 방법이 없나요?


원래 실행할려고 햇던거는 행렬 입력받아서

그 행렬만큼 랜덤으로 0이나 1출력후에

빙고체크하는 거 만들려고 햇거든요ㅠㅠ


코드첨부합니다.


#include <iostream>

#include <cstdlib>

#include <ctime>

using namespace std;


void createchecker(int checker[][],int row,int column);

void checkchecker(int checker[][],int row,int cloumn);



int main()

{

    int checkers[8][8];

    createchecker(checkers,8,8);

    checkchecker(checkers,8,8);

    return 0;

}


void createchecker(int checker[][],int row,int column)

{

     srand(time(0));

     for(int i = 0; i < row; i++)

     {

             for(int j = 0; j < column; j++)

             {

                     checker[i][j] = rand() % 2;

                     cout << checker[i][j] << " ";

             }

             cout << "\n";

     }

}


void checkchecker(int checker[][],int row,int column)

{

     int save;

     bool check;

     for(int i = 0; i < row; i++)

     {

             save = checker[i][0];

             for(int j = 0; j < column; j++)

             {

                     if(save != checker[i][j])

                     {

                              check = false;

                              break;

                     }

                     check = true;

             }

             if(check == true)

             cout << i << "번째 행 " << save << "로 빙고~ " << endl;

     }

     for(int i = 0; i < column; i++)

     {

             save = checker[0][i];

             for(int j = 0; j < row; j++)

             {

                     if(save != checker[j][i])

                     {

                              check = false;

                              break;

                     }

                     check = true;

             }

             if(check == true)

             cout << i << "번째 열 " << save << "로 빙고~ " << endl;

     }

    if(row == column)

    {

           save = checker[0][0];

           for(int i = 0; i < row; i++)

           {

                   if(save != checker[i][i])

                   {

                           check = false;

                           break;

                   }

                   check = true;

           }

           if(check == true)

           cout << "대각선 빙고" << endl;

           save = checker[0][row];

           for(int i = 0; i < row; i++)

           {

                   if(save != checker[i][row - i])

                   {

                           check = false;

                           break;

                   }

                   check = true;

           }

           if(check == true)

           cout << "대각선 빙고" << endl;

    }

}