Program does not execute the two For loops inside the if - C [closed]

1

I have 2 links in an if , as shown below:

              if (grid[j][k] == words[i][0]){ 
                    int el = j, col = k;
                    //Metodo direita, baixo
                    for(l=0;l < wordlen(search_word);l++){
                        if(l%2 != 0 ){
                            // Procura à direita
                            if(words[i][l] == grid[el][col]) {
                                matched[el][col] = 1;
                                col++;
                                if(words[i][l+1]=='
              if (grid[j][k] == words[i][0]){ 
                    int el = j, col = k;
                    //Metodo direita, baixo
                    for(l=0;l < wordlen(search_word);l++){
                        if(l%2 != 0 ){
                            // Procura à direita
                            if(words[i][l] == grid[el][col]) {
                                matched[el][col] = 1;
                                col++;
                                if(words[i][l+1]=='%pre%') {
                                    break;
                                }
                            }
                        } else {
                            // Procura à baixo
                            if(words[i][l] == grid[el][col]) {
                                matched[el][col] = 1;
                                el++;
                                if(words[i][l+1]=='%pre%') {
                                    break;
                                }
                            }
                        }
                    }
                    //Metodo baixo, direita
                    for(l=0;l < wordlen(search_word);l++){
                        if(l%2 == 0){
                            // Procura à direita
                            if(words[i][l] == grid[el][col]) {
                                matched[el][col] = 1;
                                col++;
                                if(words[i][l+1]=='%pre%') {
                                    break;
                                }
                            }
                        } else {
                            // Procura à baixo
                            if(words[i][l] == grid[el][col]) {
                                matched[el][col] = 1;
                                el++;
                                if(words[i][l+1]=='%pre%') {
                                    break;
                                }
                            }
                        }
                    }   
                }
') { break; } } } else { // Procura à baixo if(words[i][l] == grid[el][col]) { matched[el][col] = 1; el++; if(words[i][l+1]=='%pre%') { break; } } } } //Metodo baixo, direita for(l=0;l < wordlen(search_word);l++){ if(l%2 == 0){ // Procura à direita if(words[i][l] == grid[el][col]) { matched[el][col] = 1; col++; if(words[i][l+1]=='%pre%') { break; } } } else { // Procura à baixo if(words[i][l] == grid[el][col]) { matched[el][col] = 1; el++; if(words[i][l+1]=='%pre%') { break; } } } } }

The intention is that he go through the 2 loops, but he only executes the first. Does anyone know why?

    
asked by anonymous 20.09.2018 / 01:58

0 answers