#241
Se dau două şiruri a şi b, cu n, respectiv m elemente, numere naturale, ordonate crescător. Să se construiască un al treilea şir, c, care să conţină, în ordine crescătoare, elementele din şirurile a şi b.
| Problema | Interclasare | Operații I/O |
interclasare.in/interclasare.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
| Id soluție | #64661409 | Utilizator | |
| Fișier | interclasare.cpp | Dimensiune | 796 B |
| Data încărcării | 21 Mai 2026, 09:38 | Scor/rezultat | Eroare de compilare |
interclasare.cpp:4:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 4 | ofstream fout("interclasare.out") | ^~~~~~~~ interclasare.cpp: In function ‘int main()’: interclasare.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n; | ^ interclasare.cpp:10:14: error: ‘a’ was not declared in this scope 10 | fin>>a[i]; | ^ interclasare.cpp:11:10: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 11 | fin>>m; | ^ | tm interclasare.cpp:13:14: error: ‘b’ was not declared in this scope 13 | fin>>b[j]; | ^ interclasare.cpp:14:5: error: ‘i’ was not declared in this scope 14 | i=1; | ^ interclasare.cpp:15:5: error: ‘j’ was not declared in this scope 15 | j=1; | ^ interclasare.cpp:16:5: error: ‘k’ was not declared in this scope 16 | k=0; | ^ interclasare.cpp:19:12: error: ‘a’ was not declared in this scope 19 | if(a[i]<b[j]){ | ^ interclasare.cpp:19:17: error: ‘b’ was not declared in this scope 19 | if(a[i]<b[j]){ | ^ interclasare.cpp:20:13: error: ‘c’ was not declared in this scope 20 | c[k]=a[i]; | ^ interclasare.cpp:24:13: error: ‘c’ was not declared in this scope 24 | c[k]=b[j]; | ^ interclasare.cpp:30:9: error: ‘c’ was not declared in this scope 30 | c[k]=a[i]; | ^ interclasare.cpp:30:14: error: ‘a’ was not declared in this scope 30 | c[k]=a[i]; | ^ interclasare.cpp:35:9: error: ‘c’ was not declared in this scope 35 | c[k]=b[j]; | ^ interclasare.cpp:35:14: error: ‘b’ was not declared in this scope 35 | c[k]=b[j]; | ^ interclasare.cpp:39:9: error: ‘fout’ was not declared in this scope 39 | fout<<c[l]<<" "; | ^~~~ interclasare.cpp:39:15: error: ‘c’ was not declared in this scope 39 | fout<<c[l]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare 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ă.