#250
Se dau două şiruri a şi b, cu n, respectiv m elemente, numere naturale, ordonate strict crescător. Să se afişeze, în ordine strict crescătoare, valorile existente în cel puţin unul dintre cele două şiruri.
Variante Bacalaureat 2009
| Problema | Interclasare1 | Operații I/O |
interclasare1.in/interclasare1.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64114033 | Utilizator | |
| Fișier | interclasare1.cpp | Dimensiune | 1003 B |
| Data încărcării | 17 Aprilie 2026, 17:34 | Scor/rezultat | Eroare de compilare |
interclasare1.cpp: In function ‘int main()’: interclasare1.cpp:7:9: error: expected ‘,’ or ‘;’ before ‘ofstream’ 7 | ofstream fout("interclasare1.out") | ^~~~~~~~ interclasare1.cpp:9:10: error: ‘n’ was not declared in this scope 9 | fin>>n; | ^ interclasare1.cpp:11:9: error: expected initializer before ‘for’ 11 | for(i=1;i<=n;i++) | ^~~ interclasare1.cpp:11:17: error: ‘i’ was not declared in this scope 11 | for(i=1;i<=n;i++) | ^ interclasare1.cpp:13:14: error: ‘m’ was not declared in this scope; did you mean ‘tm’? 13 | fin>>m>>x; | ^ | tm interclasare1.cpp:13:17: error: ‘x’ was not declared in this scope 13 | fin>>m>>x; | ^ interclasare1.cpp:15:5: error: ‘j’ was not declared in this scope 15 | j=1; | ^ interclasare1.cpp:16:5: error: ‘k’ was not declared in this scope 16 | k=0; | ^ interclasare1.cpp:19:12: error: ‘v’ was not declared in this scope 19 | if(v[i]<x) | ^ interclasare1.cpp:21:9: error: ‘fout’ was not declared in this scope 21 | fout<<v[i]<<" "; | ^~~~ interclasare1.cpp:28:9: error: ‘fout’ was not declared in this scope 28 | fout<<x<<" "; | ^~~~ interclasare1.cpp:35:9: error: ‘fout’ was not declared in this scope 35 | fout<<<v[i]<<" "; | ^~~~ interclasare1.cpp:35:15: error: expected primary-expression before ‘<’ token 35 | fout<<<v[i]<<" "; | ^ interclasare1.cpp:37:9: error: ‘J’ was not declared in this scope 37 | J++; | ^ interclasare1.cpp:42:9: error: ‘fout’ was not declared in this scope 42 | fout<<endl; | ^~~~ interclasare1.cpp:41:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 41 | if(k%10==0) | ^~ interclasare1.cpp:43:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 43 | while(i<=n) | ^~~~~ interclasare1.cpp:45:9: error: ‘fout’ was not declared in this scope 45 | fout<<v[i]<<" "; | ^~~~ interclasare1.cpp:45:15: error: ‘v’ was not declared in this scope 45 | fout<<v[i]<<" "; | ^ interclasare1.cpp:53:9: error: ‘fout’ was not declared in this scope 53 | fout<<x<<" "; | ^~~~ interclasare1.cpp:61:2: error: expected ‘}’ at end of input 61 | } | ^ interclasare1.cpp:5:1: note: to match this ‘{’ 5 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Interclasare1 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ă.