#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 | #64657005 | Utilizator | |
| Fișier | interclasare.cpp | Dimensiune | 824 B |
| Data încărcării | 20 Mai 2026, 21:38 | Scor/rezultat | Eroare de compilare |
interclasare.cpp: In function ‘int main()’: interclasare.cpp:9:5: error: expected ‘,’ or ‘;’ before ‘int’ 9 | int a[101], b[101], c[101], i, j, k, n, m; | ^~~ interclasare.cpp:10:10: error: ‘n’ was not declared in this scope 10 | fin>>n; | ^ interclasare.cpp:11:10: error: ‘i’ was not declared in this scope 11 | for (i=1; i<=n; i++) | ^ interclasare.cpp:12:10: error: ‘a’ was not declared in this scope 12 | fin>>a[i]; | ^ interclasare.cpp:13:10: error: ‘j’ was not declared in this scope 13 | for (j=1; j<=n; j++) | ^ interclasare.cpp:14:10: error: ‘b’ was not declared in this scope 14 | fin>>b[j]; | ^ interclasare.cpp:15:5: error: ‘i’ was not declared in this scope 15 | i=1; j=1; k=1; | ^ interclasare.cpp:15:10: error: ‘j’ was not declared in this scope 15 | i=1; j=1; k=1; | ^ interclasare.cpp:15:15: error: ‘k’ was not declared in this scope 15 | i=1; j=1; k=1; | ^ interclasare.cpp:16:16: error: expected ‘)’ before ‘;’ token 16 | while (i<=n; j<=m) | ~ ^ | ) interclasare.cpp:16:5: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 16 | while (i<=n; j<=m) | ^~~~~ interclasare.cpp:16:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 16 | while (i<=n; j<=m) | ^ interclasare.cpp:16:21: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 16 | while (i<=n; j<=m) | ^ | tm interclasare.cpp:34:9: error: ‘c’ was not declared in this scope 34 | c[k]=a[i]; | ^ interclasare.cpp:34:14: error: ‘a’ was not declared in this scope 34 | c[k]=a[i]; | ^ interclasare.cpp:40:9: error: ‘c’ was not declared in this scope 40 | c[k]=b[j]; | ^ interclasare.cpp:40:14: error: ‘b’ was not declared in this scope 40 | c[k]=b[j]; | ^ interclasare.cpp:45:11: error: ‘c’ was not declared in this scope 45 | 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ă.