#284
Se dau două şiruri, cu n, respectiv m, elemente, numere naturale. Primul şir este ordonat crescător, iar al doilea element este ordonat descrescător. Să se afişeze, în ordine crescătoare, valorile pare din cele două şiruri.
| Problema | Interclasare3 | Operații I/O |
interclasare3.in/interclasare3.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64120176 | Utilizator | |
| Fișier | interclasare3.cpp | Dimensiune | 877 B |
| Data încărcării | 18 Aprilie 2026, 13:01 | Scor/rezultat | Eroare de compilare |
interclasare3.cpp:5:1: error: expected ‘,’ or ‘;’ before ‘int’ 5 | int n, m, a[100001], b[100001], i, j, k, c[200002], nr, cnta, cntb; | ^~~ interclasare3.cpp: In function ‘int main()’: interclasare3.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n>>m; | ^ interclasare3.cpp:8:13: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 8 | fin>>n>>m; | ^ | tm interclasare3.cpp:9:10: error: ‘i’ was not declared in this scope 9 | for (i=1; i<=n; i++) | ^ interclasare3.cpp:11:14: error: ‘nr’ was not declared in this scope 11 | fin>>nr; | ^~ interclasare3.cpp:13:13: error: ‘a’ was not declared in this scope 13 | a[++cnta]=nr; | ^ interclasare3.cpp:13:17: error: ‘cnta’ was not declared in this scope 13 | a[++cnta]=nr; | ^~~~ interclasare3.cpp:15:10: error: ‘j’ was not declared in this scope 15 | for (j=1; j<=m; j++) | ^ interclasare3.cpp:17:14: error: ‘nr’ was not declared in this scope 17 | fin>>nr; | ^~ interclasare3.cpp:19:13: error: ‘b’ was not declared in this scope 19 | b[++cntb]=nr; | ^ interclasare3.cpp:19:17: error: ‘cntb’ was not declared in this scope 19 | b[++cntb]=nr; | ^~~~ interclasare3.cpp:21:5: error: ‘i’ was not declared in this scope 21 | i=1; | ^ interclasare3.cpp:22:5: error: ‘j’ was not declared in this scope 22 | j=cntb; | ^ interclasare3.cpp:22:7: error: ‘cntb’ was not declared in this scope 22 | j=cntb; | ^~~~ interclasare3.cpp:23:5: error: ‘k’ was not declared in this scope 23 | k=1; | ^ interclasare3.cpp:24:15: error: ‘cnta’ was not declared in this scope 24 | while (i<=cnta && j>=1) | ^~~~ interclasare3.cpp:26:13: error: ‘a’ was not declared in this scope 26 | if (a[i]<b[j]) | ^ interclasare3.cpp:26:18: error: ‘b’ was not declared in this scope 26 | if (a[i]<b[j]) | ^ interclasare3.cpp:27:13: error: ‘c’ was not declared in this scope 27 | c[k++]=a[i++]; | ^ interclasare3.cpp:29:13: error: ‘c’ was not declared in this scope 29 | c[k++]=b[j--]; | ^ interclasare3.cpp:32:15: error: ‘cnta’ was not declared in this scope 32 | while (i<=cnta) | ^~~~ interclasare3.cpp:33:13: error: ‘a’ was not declared in this scope 33 | if (a[i]%2==0) | ^ interclasare3.cpp:34:13: error: ‘c’ was not declared in this scope 34 | c[k++]=a[i++]; | ^ interclasare3.cpp:36:13: error: ‘b’ was not declared in this scope 36 | if (b[j]%2==0) | ^ interclasare3.cpp:37:13: error: ‘c’ was not declared in this scope 37 | c[k++]=b[j--]; | ^ interclasare3.cpp:40:15: error: ‘c’ was not declared in this scope 40 | fout<<c[i]<<" "; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare3 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ă.