#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 | #14617430 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 682 B |
Data încărcării | 11 Martie 2019, 08:36 | Scor / rezultat | Eroare de compilare |
interclasare.cpp: In function 'int main()': interclasare.cpp:8:6: error: expected ',' or ';' before 'ofstream' ofstream fout("interclasare") ^ interclasare.cpp:10:10: error: 'n' was not declared in this scope fin>>n>>m; ^ interclasare.cpp:10:13: error: 'm' was not declared in this scope fin>>n>>m; ^ interclasare.cpp:11:10: error: 'i' was not declared in this scope for (i=0;i<n;i++) ^ interclasare.cpp:12:9: error: 'cin' was not declared in this scope cin>>a[i]; ^ interclasare.cpp:12:14: error: 'a' was not declared in this scope cin>>a[i]; ^ interclasare.cpp:13:9: error: 'i' was not declared in this scope for(i=0;i<m;i++) ^ interclasare.cpp:14:14: error: 'b' was not declared in this scope fin>>b[i]; ^ interclasare.cpp:15:5: error: 'i' was not declared in this scope i=0; ^ interclasare.cpp:16:5: error: 'j' was not declared in this scope j=0; ^ interclasare.cpp:17:5: error: 'k' was not declared in this scope k=0; ^ interclasare.cpp:19:12: error: 'a' was not declared in this scope if(a[i]<b[j]) ^ interclasare.cpp:19:17: error: 'b' was not declared in this scope if(a[i]<b[j]) ^ interclasare.cpp:20:14: error: 'c' was not declared in this scope {c[k]=a[i]; ^ interclasare.cpp:25:5: error: 'c' was not declared in this scope c[k]=b[j]; ^ interclasare.cpp:29:13: error: 'l' was not declared in this scope for(l=i;l<n;l++) ^ interclasare.cpp:30:10: error: 'c' was not declared in this scope {c[k]=a[l]; ^ interclasare.cpp:30:15: error: 'a' was not declared in this scope {c[k]=a[l]; ^ interclasare.cpp:33:14: error: 'l' was not declared in this scope for (l=j;l<m;l++) ^ interclasare.cpp:34:9: error: 'c' was not declared in this scope {c[k]=b[l]; ^ interclasare.cpp:34:14: error: 'b' was not declared in this scope {c[k]=b[l]; ^ interclasare.cpp:37:9: error: 'fout' was not declared in this scope fout<<c[i]<<" "; ^ interclasare.cpp:37:15: error: 'c' was not declared in this scope 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ă.