#241
Interclasare
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 | #9239582 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 1.09 KB |
Data încărcării | 19 Aprilie 2018, 08:38 | Scor / rezultat | Eroare de compilare |
interclasare.cpp:15:6: error: expected ',' or ';' before 'ofstream' ofstream fout ("interclasare.out") ^ interclasare.cpp: In function 'int main()': interclasare.cpp:19:10: error: 'n' was not declared in this scope fin >> n; ^ interclasare.cpp:20:8: error: 'i' was not declared in this scope for (i = 0; i < n; i++) ^ interclasare.cpp:21:12: error: 'a' was not declared in this scope fin >> a[i]; ^ interclasare.cpp:22:8: error: 'i' was not declared in this scope for (i = 0; i < m; i++) ^ interclasare.cpp:22:19: error: 'm' was not declared in this scope for (i = 0; i < m; i++) ^ interclasare.cpp:23:12: error: 'b' was not declared in this scope fin >> b[i]; ^ interclasare.cpp:24:3: error: 'i' was not declared in this scope i = 0; ^ interclasare.cpp:25:3: error: 'j' was not declared in this scope j = 0; ^ interclasare.cpp:26:3: error: 'k' was not declared in this scope k = 0; ^ interclasare.cpp:27:24: error: 'm' was not declared in this scope while (i < n and j < m) ^ interclasare.cpp:28:10: error: 'a' was not declared in this scope {if (a[i] < b[j]) ^ interclasare.cpp:28:17: error: 'b' was not declared in this scope {if (a[i] < b[j]) ^ interclasare.cpp:30:2: error: 'fout' was not declared in this scope fout << a[i] << " "; ^ interclasare.cpp:36:2: error: 'fout' was not declared in this scope fout << b[j] << " "; ^ interclasare.cpp:40:11: error: expected ')' before numeric constant if (k++ 10) ^ interclasare.cpp:42:7: error: 'fout' was not declared in this scope fout << endl; ^ interclasare.cpp:46:14: error: 'm' was not declared in this scope for (; j < m; j++) ^ interclasare.cpp:48:7: error: 'fout' was not declared in this scope fout << b[j] << " "; ^ interclasare.cpp:48:15: error: 'b' was not declared in this scope fout << b[j] << " "; ^ interclasare.cpp:57:3: error: 'fout' was not declared in this scope fout.close (); ^ interclasare.cpp: At global scope: interclasare.cpp:76:1: error: expected declaration before '}' token } ^
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ă.