#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 | #50473360 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 703 B |
Data încărcării | 10 Aprilie 2024, 19:44 | Scor / rezultat | Eroare de compilare |
interclasare.cpp: In function 'int main()': interclasare.cpp:9:8: error: expected ';' before 'a' in a[100000], n, b[100000], m, c[200000], i, k, j; ^ interclasare.cpp:9:54: warning: statement has no effect [-Wunused-value] in a[100000], n, b[100000], m, c[200000], i, k, j; ^ interclasare.cpp:10:9: error: 'n' was not declared in this scope in>>n; ^ interclasare.cpp:11:10: error: 'i' was not declared in this scope for (i=1; i<=n; i++) ^ interclasare.cpp:12:13: error: 'a' was not declared in this scope in>>a[i]; ^ interclasare.cpp:13:9: error: 'm' was not declared in this scope in>>m; ^ interclasare.cpp:14:10: error: 'i' was not declared in this scope for (i=1; i<=m; i++) ^ interclasare.cpp:15:13: error: 'b' was not declared in this scope in>>b[i]; ^ interclasare.cpp:16:5: error: 'i' was not declared in this scope i=1; ^ interclasare.cpp:17:5: error: 'k' was not declared in this scope k=1; ^ interclasare.cpp:19:21: error: 'j' was not declared in this scope while (i<=n and j<=m) ^ interclasare.cpp:20:13: error: 'a' was not declared in this scope if (a[i]<b[j]) ^ interclasare.cpp:20:18: error: 'b' was not declared in this scope if (a[i]<b[j]) ^ interclasare.cpp:22:9: error: 'c' was not declared in this scope c[++k]=a[i++]; ^ interclasare.cpp:25:9: error: 'c' was not declared in this scope c[++k]=b[i++]; ^ interclasare.cpp:27:9: error: 'c' was not declared in this scope c[++k]=b[j++]; ^ interclasare.cpp:27:16: error: 'b' was not declared in this scope c[++k]=b[j++]; ^ interclasare.cpp:27:18: error: 'j' was not declared in this scope c[++k]=b[j++]; ^ interclasare.cpp:28:12: error: 'j' was not declared in this scope while (j<=m) ^ interclasare.cpp:29:9: error: 'c' was not declared in this scope c[++k]=b[j++]; ^ interclasare.cpp:29:16: error: 'b' was not declared in this scope c[++k]=b[j++]; ^ interclasare.cpp:32:18: error: 'c' was not declared in this scope out<<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ă.