#231
Exista
Scrieţi un program care citeşte un tablou bidimensional cu m
linii şi n
coloane şi un număr k
şi determină suma indicilor coloanelor care conţin valoarea k
.
Variante Bacalaureat 2009
Problema | Exista | Operații I/O |
exista.in /exista.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54032168 | Utilizator | |
Fișier | exista.cpp | Dimensiune | 457 B |
Data încărcării | 18 Noiembrie 2024, 12:19 | Scor / rezultat | Eroare de compilare |
exista.cpp:4:28: warning: missing terminating " character [enabled by default] ofstream cout("exista.out")" ^ exista.cpp:4:1: error: missing terminating " character ofstream cout("exista.out")" ^ exista.cpp:5:5: error: expected ',' or ';' before 'int' int n,m,k,i,j,gasit,a[11][11]; ^ exista.cpp: In function 'int main()': exista.cpp:7:10: error: 'k' was not declared in this scope cin>>k>>m>>n; ^ exista.cpp:7:13: error: 'm' was not declared in this scope cin>>k>>m>>n; ^ exista.cpp:7:16: error: 'n' was not declared in this scope cin>>k>>m>>n; ^ exista.cpp:8:8: error: 'i' was not declared in this scope for(i=1;i=<m;i++) ^ exista.cpp:8:14: error: expected primary-expression before '<' token for(i=1;i=<m;i++) ^ exista.cpp:9:12: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ exista.cpp:10:13: error: 'a' was not declared in this scope cin>>a[i][j]; ^ exista.cpp:12:9: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ exista.cpp:14:9: error: 'gasit' was not declared in this scope gasit =0; ^ exista.cpp:15:11: error: 'i' was not declared in this scope for(i=1;i<=m &&!gasit;i++) ^ exista.cpp:16:15: error: 'a' was not declared in this scope if (a[i][j]==k)gasit=1 ^ exista.cpp:17:11: error: expected ';' before 'if' if (gasit==1)s=s+j; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Exista 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ă.