#777
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se determine câte coloane ale matricei au elementele distincte două câte două.
| Problema | CntColoane | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64664570 | Utilizator | |
| Fișier | cntcoloane.cpp | Dimensiune | 558 B |
| Data încărcării | 21 Mai 2026, 11:25 | Scor/rezultat | Eroare de compilare |
cntcoloane.cpp: In function ‘int main()’: cntcoloane.cpp:12:40: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 12 | if (v[i][j] == mat[k][j] OK= false; | ^ cntcoloane.cpp:12:51: error: ‘mat’ was not declared in this scope 12 | if (v[i][j] == mat[k][j] OK= false; | ^~~ cntcoloane.cpp:13:32: error: expected primary-expression before ‘if’ 13 | if (OK== true)c++; | ^~ cntcoloane.cpp:12:71: error: expected ‘)’ before ‘if’ 12 | if (v[i][j] == mat[k][j] OK= false; | ~ ^ | ) 13 | if (OK== true)c++; | ~~ cntcoloane.cpp:9:37: warning: unused variable ‘OK’ [-Wunused-variable] 9 | for (j = 1; j <= m; j++) { bool OK = true; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CntColoane face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.