ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 13.09.2021 15:07:29

ამოცანა: გუბურების დათვლა

მომხმარებელი: kkupr17

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <iostream>

using namespace std;

void seeker(int[][] &db, int n, int m){
    if(db[n][m] == '.') return;
    else db[n][m] = '.';

    if(m > 0) seeker(db, n, m-1);
    if(m > 0 && n > 0) seeker(db, n-1, m-1);
    if(n > 0) seeker(db, n-1, m);
    if(m < sizeof db[0]) seeker(db, n, m+1);
    if(m < sizeof db[0] && n > 0) seeker(db, n-1, m+1);
    if(n < sizeof db / sizeof db[0]) seeker(db, n+1, m);
    if(n < sizeof db / sizeof db[0] && m < sizeof db[0]) seeker(db, n+1, m+1);
    if(n < sizeof db / sizeof db[0] && m > 0) seeker(db, n+1, m-1);
}

int main(){

    int n, m, total = 0;
    cin>>n;
    cin>>m;

    char farm[n][m];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin>>farm[i][j];
        }
    }

    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(farm[n][m] == 'W'){
                total++;
                seeker(farm);
            }
        }
    }

    return 0;
}
PROB_cpp_UID1653PID262_6566d5/main.cpp:5:19: error: multidimensional array must have bounds for all dimensions except the first
 void seeker(int[][] &db, int n, int m){
                   ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:5:21: error: expected ',' or '...' before '&' token
 void seeker(int[][] &db, int n, int m){
                     ^
PROB_cpp_UID1653PID262_6566d5/main.cpp: In function 'void seeker()':
PROB_cpp_UID1653PID262_6566d5/main.cpp:6:8: error: 'db' was not declared in this scope
     if(db[n][m] == '.') return;
        ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:6:11: error: 'n' was not declared in this scope
     if(db[n][m] == '.') return;
           ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:6:14: error: 'm' was not declared in this scope
     if(db[n][m] == '.') return;
              ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:9:8: error: 'm' was not declared in this scope
     if(m > 0) seeker(db, n, m-1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:9:22: error: 'db' was not declared in this scope
     if(m > 0) seeker(db, n, m-1);
                      ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:9:26: error: 'n' was not declared in this scope
     if(m > 0) seeker(db, n, m-1);
                          ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:10:8: error: 'm' was not declared in this scope
     if(m > 0 && n > 0) seeker(db, n-1, m-1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:10:17: error: 'n' was not declared in this scope
     if(m > 0 && n > 0) seeker(db, n-1, m-1);
                 ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:10:31: error: 'db' was not declared in this scope
     if(m > 0 && n > 0) seeker(db, n-1, m-1);
                               ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:11:8: error: 'n' was not declared in this scope
     if(n > 0) seeker(db, n-1, m);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:11:22: error: 'db' was not declared in this scope
     if(n > 0) seeker(db, n-1, m);
                      ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:11:31: error: 'm' was not declared in this scope
     if(n > 0) seeker(db, n-1, m);
                               ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:12:8: error: 'm' was not declared in this scope
     if(m < sizeof db[0]) seeker(db, n, m+1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:12:19: error: 'db' was not declared in this scope
     if(m < sizeof db[0]) seeker(db, n, m+1);
                   ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:12:37: error: 'n' was not declared in this scope
     if(m < sizeof db[0]) seeker(db, n, m+1);
                                     ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:13:8: error: 'm' was not declared in this scope
     if(m < sizeof db[0] && n > 0) seeker(db, n-1, m+1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:13:19: error: 'db' was not declared in this scope
     if(m < sizeof db[0] && n > 0) seeker(db, n-1, m+1);
                   ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:13:28: error: 'n' was not declared in this scope
     if(m < sizeof db[0] && n > 0) seeker(db, n-1, m+1);
                            ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:14:8: error: 'n' was not declared in this scope
     if(n < sizeof db / sizeof db[0]) seeker(db, n+1, m);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:14:19: error: 'db' was not declared in this scope
     if(n < sizeof db / sizeof db[0]) seeker(db, n+1, m);
                   ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:14:54: error: 'm' was not declared in this scope
     if(n < sizeof db / sizeof db[0]) seeker(db, n+1, m);
                                                      ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:15:8: error: 'n' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m < sizeof db[0]) seeker(db, n+1, m+1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:15:19: error: 'db' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m < sizeof db[0]) seeker(db, n+1, m+1);
                   ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:15:40: error: 'm' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m < sizeof db[0]) seeker(db, n+1, m+1);
                                        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:16:8: error: 'n' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m > 0) seeker(db, n+1, m-1);
        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:16:19: error: 'db' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m > 0) seeker(db, n+1, m-1);
                   ^~
PROB_cpp_UID1653PID262_6566d5/main.cpp:16:40: error: 'm' was not declared in this scope
     if(n < sizeof db / sizeof db[0] && m > 0) seeker(db, n+1, m-1);
                                        ^
PROB_cpp_UID1653PID262_6566d5/main.cpp: In function 'int main()':
PROB_cpp_UID1653PID262_6566d5/main.cpp:36:28: error: too many arguments to function 'void seeker()'
                 seeker(farm);
                            ^
PROB_cpp_UID1653PID262_6566d5/main.cpp:5:6: note: declared here
 void seeker(int[][] &db, int n, int m){
      ^~~~~~