#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 | #39898071 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 591 B |
Data încărcării | 21 Noiembrie 2022, 10:38 | Scor / rezultat | Eroare de compilare |
interclasare.cpp:29:21: error: empty character constant fout<<c[i]<<''; ^ interclasare.cpp:3:14: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin ("interclasare.in"); ^ interclasare.cpp:4:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("interclasare.out"); ^ interclasare.cpp: In function 'int main()': interclasare.cpp:11:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=0,i<n,++i) ^ interclasare.cpp:11:20: error: expected ';' before ')' token for(i=0,i<n,++i) ^ interclasare.cpp:14:5: error: expected primary-expression before 'for' for(i=0,i<m,++i) ^ interclasare.cpp:14:5: error: expected ')' before 'for' interclasare.cpp:14:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=0,i<m,++i) ^ interclasare.cpp:14:20: error: expected ';' before ')' token for(i=0,i<m,++i) ^ interclasare.cpp:16:12: error: expected ';' before ',' token int x=0,y=0,z=0; ^ interclasare.cpp:16:12: error: expected primary-expression before ',' token interclasare.cpp:16:13: error: 'y' was not declared in this scope int x=0,y=0,z=0; ^ interclasare.cpp:16:17: error: 'z' was not declared in this scope int x=0,y=0,z=0; ^ interclasare.cpp:16:20: error: expected ')' before ';' token int x=0,y=0,z=0; ^ interclasare.cpp:16:9: warning: unused variable 'x' [-Wunused-variable] int x=0,y=0,z=0; ^ interclasare.cpp:17:11: error: 'x' was not declared in this scope while(x<n&&y<m) ^ interclasare.cpp:17:16: error: 'y' was not declared in this scope while(x<n&&y<m) ^ interclasare.cpp:19:11: error: 'z' was not declared in this scope c[z++]=a[x++]; ^ interclasare.cpp:21:11: error: 'z' was not declared in this scope c[z++]=v[y++]; ^ interclasare.cpp:21:16: error: 'v' was not declared in this scope c[z++]=v[y++]; ^ interclasare.cpp:22:11: error: 'x' was not declared in this scope while(x<n) ^ interclasare.cpp:23:11: error: 'z' was not declared in this scope c[z++]=a[x++]; ^ interclasare.cpp:24:11: error: 'y' was not declared in this scope while(y<m) ^ interclasare.cpp:25:11: error: 'z' was not declared in this scope c[z++]=v[y++]; ^ interclasare.cpp:25:16: error: 'v' was not declared in this scope c[z++]=v[y++]; ^ interclasare.cpp:27:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=0,i<o,++i) ^ interclasare.cpp:27:20: error: expected ';' before ')' token for(i=0,i<o,++i) ^ interclasare.cpp:30:1: error: expected primary-expression before '}' token } ^ interclasare.cpp:30:1: error: expected ';' before '}' token interclasare.cpp:30:1: error: expected primary-expression before '}' token interclasare.cpp:30:1: error: expected ')' before '}' token interclasare.cpp:30:1: error: expected primary-expression before '}' token interclasare.cpp:30:1: error: expected ';' before '}' token
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ă.