#250
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 cel puţin unul dintre cele două şiruri.
Variante Bacalaureat 2009
| Problema | Interclasare1 | Operații I/O |
interclasare1.in/interclasare1.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64114023 | Utilizator | |
| Fișier | interclasare1.cpp | Dimensiune | 938 B |
| Data încărcării | 17 Aprilie 2026, 17:34 | Scor/rezultat | Eroare de compilare |
interclasare1.cpp: In function ‘int main()’: interclasare1.cpp:5:17: error: variable ‘std::ifstream fin’ has initializer but incomplete type 5 | ifstream fin ("interclasare1.in") | ^ interclasare1.cpp:6:4: error: expected ‘,’ or ‘;’ before ‘ofstream’ 6 | ofstream fout("interclasare1.out") | ^~~~~~~~ interclasare1.cpp:8:9: error: ‘n’ was not declared in this scope 8 | fin<<n; | ^ interclasare1.cpp:10:8: error: ‘i’ was not declared in this scope 10 | for(i=1;i<=n;i++) | ^ interclasare1.cpp:11:12: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 11 | fin>>m>>x; | ^ | tm interclasare1.cpp:11:15: error: ‘x’ was not declared in this scope 11 | fin>>m>>x; | ^ interclasare1.cpp:10:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=n;i++) | ^~~ interclasare1.cpp:12:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 12 | i=1;j=1; | ^ interclasare1.cpp:12:7: error: ‘i’ was not declared in this scope interclasare1.cpp:12:11: error: ‘j’ was not declared in this scope 12 | i=1;j=1; | ^ interclasare1.cpp:13:7: error: ‘k’ was not declared in this scope 13 | k=0; | ^ interclasare1.cpp:14:22: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 14 | while(i<=n&&j<=m) | ^ | tm interclasare1.cpp:16:15: error: ‘v’ was not declared in this scope 16 | if (v[i]<x) | ^ interclasare1.cpp:16:20: error: ‘x’ was not declared in this scope 16 | if (v[i]<x) | ^ interclasare1.cpp:17:13: error: ‘fout’ was not declared in this scope 17 | { fout<v[i]<<" "; | ^~~~ interclasare1.cpp:23:13: error: ‘fout’ was not declared in this scope 23 | { fout<<x<<" "; | ^~~~ interclasare1.cpp:28:13: error: ‘fout’ was not declared in this scope 28 | { fout<<v[i]<<" "; | ^~~~ interclasare1.cpp:33:11: error: ‘fout’ was not declared in this scope 33 | fout<<endl; | ^~~~ interclasare1.cpp:37:9: error: ‘fout’ was not declared in this scope 37 | { fout<<v[i]<<" "; | ^~~~ interclasare1.cpp:37:15: error: ‘v’ was not declared in this scope 37 | { fout<<v[i]<<" "; | ^ interclasare1.cpp:42:16: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 42 | while(j<=m) | ^ | tm interclasare1.cpp:43:9: error: ‘fout’ was not declared in this scope 43 | { fout<<x<<" "; | ^~~~ interclasare1.cpp:43:15: error: ‘x’ was not declared in this scope 43 | { fout<<x<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare1 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ă.