#251
Se dau două şiruri a şi b, cu n, respectiv m elemente, numere naturale, ordonate strict crescător. Să se afişeze, în ordine strict crescătoare, valorile existente în ambele şiruri.
Variante Bacalaureat 2009
| Problema | Interclasare2 | Operații I/O |
interclasare2.in/interclasare2.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64210057 | Utilizator | |
| Fișier | interclasare2.cpp | Dimensiune | 785 B |
| Data încărcării | 23 Aprilie 2026, 09:16 | Scor/rezultat | Eroare de compilare |
interclasare2.cpp:6:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 6 | ofstream fout("interclasare2.out") | ^~~~~~~~ interclasare2.cpp:9:1: error: expected initializer before ‘fin’ 9 | fin>>n; | ^~~ interclasare2.cpp:10:1: error: expected unqualified-id before ‘for’ 10 | for(int i=0;i<=n;i++) | ^~~ interclasare2.cpp:10:13: error: ‘i’ does not name a type 10 | for(int i=0;i<=n;i++) | ^ interclasare2.cpp:10:18: error: ‘i’ does not name a type 10 | for(int i=0;i<=n;i++) | ^ interclasare2.cpp:13:1: error: expected unqualified-id before ‘for’ 13 | for(int j=0;j<=m;i++) | ^~~ interclasare2.cpp:13:13: error: ‘j’ does not name a type 13 | for(int j=0;j<=m;i++) | ^ interclasare2.cpp:13:18: error: ‘i’ does not name a type 13 | for(int j=0;j<=m;i++) | ^ interclasare2.cpp:14:15: error: expected declaration before ‘}’ token 14 | fin>>b[j];} | ^ interclasare2.cpp:17:76: error: expected ‘)’ before ‘;’ token 17 | void interclasare(int a[10001],int b[10001],int c[10001],int n,int m,int &k;) | ~ ^ | ) interclasare2.cpp:17:77: error: expected unqualified-id before ‘)’ token 17 | void interclasare(int a[10001],int b[10001],int c[10001],int n,int m,int &k;) | ^ interclasare2.cpp: In function ‘int main()’: interclasare2.cpp:33:9: error: ‘n’ was not declared in this scope 33 | {citire(n,a,c,b,m) | ^ interclasare2.cpp:33:11: error: ‘a’ was not declared in this scope 33 | {citire(n,a,c,b,m) | ^ interclasare2.cpp:33:13: error: ‘c’ was not declared in this scope 33 | {citire(n,a,c,b,m) | ^ interclasare2.cpp:33:15: error: ‘b’ was not declared in this scope 33 | {citire(n,a,c,b,m) | ^ interclasare2.cpp:33:17: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 33 | {citire(n,a,c,b,m) | ^ | tm interclasare2.cpp:33:2: error: ‘citire’ was not declared in this scope; did you mean ‘ctime’? 33 | {citire(n,a,c,b,m) | ^~~~~~ | ctime interclasare2.cpp:35:13: error: ‘x’ was not declared in this scope 35 | for(int x=1;x<k;x++) | ^ interclasare2.cpp:35:15: error: ‘k’ was not declared in this scope 35 | for(int x=1;x<k;x++) | ^ interclasare2.cpp: At global scope: interclasare2.cpp:45:1: error: expected declaration before ‘}’ token 45 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare2 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ă.