#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 | #64749077 | Utilizator | |
| Fișier | interclasare.cpp | Dimensiune | 881 B |
| Data încărcării | 27 Mai 2026, 17:02 | Scor/rezultat | Eroare de compilare |
interclasare.cpp: In function ‘int main()’: interclasare.cpp:9:5: error: expected ‘,’ or ‘;’ before ‘int’ 9 | int n, m, a[41], b[41], c[81], k = 0; | ^~~ interclasare.cpp:10:12: error: ‘n’ was not declared in this scope 10 | fin >> n; | ^ interclasare.cpp:12:16: error: ‘a’ was not declared in this scope 12 | fin >> a[i]; | ^ interclasare.cpp:14:12: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 14 | fin >> m; | ^ | tm interclasare.cpp:16:16: error: ‘b’ was not declared in this scope 16 | fin >> b[i]; | ^ interclasare.cpp:22:13: error: ‘a’ was not declared in this scope 22 | if (a[i] <= b[j]) | ^ interclasare.cpp:22:21: error: ‘b’ was not declared in this scope 22 | if (a[i] <= b[j]) | ^ interclasare.cpp:24:13: error: ‘k’ was not declared in this scope 24 | k++; | ^ interclasare.cpp:25:13: error: ‘c’ was not declared in this scope 25 | c[k] = a[i]; | ^ interclasare.cpp:30:13: error: ‘k’ was not declared in this scope 30 | k++; | ^ interclasare.cpp:31:13: error: ‘c’ was not declared in this scope 31 | c[k] = b[j]; | ^ interclasare.cpp:38:9: error: ‘k’ was not declared in this scope 38 | k++; | ^ interclasare.cpp:39:9: error: ‘c’ was not declared in this scope 39 | c[k] = a[i]; | ^ interclasare.cpp:39:16: error: ‘a’ was not declared in this scope 39 | c[k] = a[i]; | ^ interclasare.cpp:45:9: error: ‘k’ was not declared in this scope 45 | k++; | ^ interclasare.cpp:46:9: error: ‘c’ was not declared in this scope 46 | c[k] = b[j]; | ^ interclasare.cpp:46:16: error: ‘b’ was not declared in this scope 46 | c[k] = b[j]; | ^ interclasare.cpp:50:26: error: ‘k’ was not declared in this scope 50 | for (int i = 1; i <= k; i++) | ^ interclasare.cpp:51:17: error: ‘c’ was not declared in this scope 51 | fout << c[i] << " "; | ^
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ă.