#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 | #58072335 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 630 B |
Data încărcării | 12 Mai 2025, 18:50 | Scor / rezultat | Eroare de compilare |
interclasare.cpp: In function 'int main()': interclasare.cpp:6:5: error: 'fint' was not declared in this scope fint a[100001], b[100001], c[200001], n, m, k, i, j; ^ interclasare.cpp:6:10: error: expected ';' before 'a' fint a[100001], b[100001], c[200001], n, m, k, i, j; ^ interclasare.cpp:7:12: error: 'n' was not declared in this scope fin >> n; for (int i = 1; i <= n; i++) fin >> a[i]; ^ interclasare.cpp:7:51: error: 'a' was not declared in this scope fin >> n; for (int i = 1; i <= n; i++) fin >> a[i]; ^ interclasare.cpp:8:12: error: 'm' was not declared in this scope fin >> m; for (int j = 1; j <= m; j++) fin >> b[j]; ^ interclasare.cpp:8:51: error: 'b' was not declared in this scope fin >> m; for (int j = 1; j <= m; j++) fin >> b[j]; ^ interclasare.cpp:9:5: error: 'i' was not declared in this scope i = 1; j = 1; k = 0; ^ interclasare.cpp:9:12: error: 'j' was not declared in this scope i = 1; j = 1; k = 0; ^ interclasare.cpp:9:19: error: 'k' was not declared in this scope i = 1; j = 1; k = 0; ^ interclasare.cpp:11:13: error: 'a' was not declared in this scope if (a[i] < b[j]) c[++k] = a[i++]; ^ interclasare.cpp:11:20: error: 'b' was not declared in this scope if (a[i] < b[j]) c[++k] = a[i++]; ^ interclasare.cpp:11:26: error: 'c' was not declared in this scope if (a[i] < b[j]) c[++k] = a[i++]; ^ interclasare.cpp:12:14: error: 'c' was not declared in this scope else c[++k] = b[j++]; ^ interclasare.cpp:13:22: error: 'c' was not declared in this scope } while (i <= n) c[++k] = a[i++]; ^ interclasare.cpp:13:31: error: 'a' was not declared in this scope } while (i <= n) c[++k] = a[i++]; ^ interclasare.cpp:14:20: error: 'c' was not declared in this scope while (j <= m) c[++k] = b[j++]; ^ interclasare.cpp:14:29: error: 'b' was not declared in this scope while (j <= m) c[++k] = b[j++]; ^ interclasare.cpp:16:17: error: 'c' was not declared in this scope fout << c[t] << " "; ^
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ă.