#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 | #64411969 | Utilizator | |
| Fișier | interclasare.cpp | Dimensiune | 955 B |
| Data încărcării | 05 Mai 2026, 17:52 | Scor/rezultat | Eroare de compilare |
interclasare.cpp:1:1: error: ‘include’ does not name a type 1 | include<fstream> | ^~~~~~~ interclasare.cpp:4:1: error: ‘ifstream’ does not name a type 4 | ifstream cin("interclasare.in") | ^~~~~~~~ interclasare.cpp: In function ‘int main()’: interclasare.cpp:10:5: error: ‘cin’ was not declared in this scope 10 | cin >> n; | ^~~ interclasare.cpp:10:12: error: ‘n’ was not declared in this scope 10 | cin >> n; | ^ interclasare.cpp:12:13: error: ‘a’ was not declared in this scope 12 | cin >> a[i]; | ^ interclasare.cpp:14:12: error: ‘m’ was not declared in this scope 14 | cin >> m | ^ interclasare.cpp:15:27: error: ‘i’ was not declared in this scope 15 | for(int i=0, i<m; i++) | ^ interclasare.cpp:17:11: error: ‘j’ was not declared in this scope 17 | i=j=k=0; | ^ interclasare.cpp:17:13: error: ‘k’ was not declared in this scope 17 | i=j=k=0; | ^ interclasare.cpp:20:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 20 | if(a[i] < b[j]0 | ^ interclasare.cpp:20:12: error: ‘a’ was not declared in this scope interclasare.cpp:20:19: error: ‘b’ was not declared in this scope 20 | if(a[i] < b[j]0 | ^ interclasare.cpp:26:12: error: expected primary-expression before ‘else’ 26 | else | ^~~~ interclasare.cpp:25:13: error: expected ‘)’ before ‘else’ 25 | } | ^ | ) 26 | else | ~~~~ interclasare.cpp:20:11: note: to match this ‘(’ 20 | if(a[i] < b[j]0 | ^ interclasare.cpp:20:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 20 | if(a[i] < b[j]0 | ^~ interclasare.cpp:34:12: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 34 | k++; | ^ interclasare.cpp:37:34: error: expected ‘)’ before ‘}’ token 37 | for (int i=0; i<k; i++} | ~ ^ | ) interclasare.cpp:37:34: error: expected primary-expression before ‘}’ token interclasare.cpp: At global scope: interclasare.cpp:38:17: error: expected unqualified-id before ‘{’ token 38 | { | ^ interclasare.cpp:43:17: error: ‘retunr’ does not name a type 43 | retunr 0; | ^~~~~~ interclasare.cpp:44:17: error: expected declaration before ‘}’ token 44 | } | ^
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ă.