#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 | #50132482 | Utilizator | |
Fișier | interclasare.cpp | Dimensiune | 977 B |
Data încărcării | 28 Martie 2024, 09:34 | Scor / rezultat | Eroare de compilare |
interclasare.cpp: In function 'void Interclasare(int, int)': interclasare.cpp:12:9: error: 'i' was not declared in this scope i=st; ^ interclasare.cpp:13:9: error: 'j' was not declared in this scope j=mid+1; ^ interclasare.cpp:14:9: error: 'k' was not declared in this scope k=0; ^ interclasare.cpp:15:28: error: expected primary-expression before '<=' token while(i<=mid and j|<=dr) ^ interclasare.cpp:16:16: error: 'v' was not declared in this scope if(v[i]<v[j]) ^ interclasare.cpp:19:13: error: 'c' was not declared in this scope c[k]=v[i]; ^ interclasare.cpp:21:9: error: expected ';' before '}' token } ^ interclasare.cpp:23:9: error: 'c' was not declared in this scope c[k]=v[j]; ^ interclasare.cpp:29:9: error: 'c' was not declared in this scope c[k]=v[i]; ^ interclasare.cpp:29:14: error: 'v' was not declared in this scope c[k]=v[i]; ^ interclasare.cpp:35:9: error: 'c' was not declared in this scope c[k]=v[j]; ^ interclasare.cpp:35:14: error: 'v' was not declared in this scope c[k]=v[j]; ^ interclasare.cpp:39:9: error: 'v' was not declared in this scope v[st+i-1]=c[i]; ^ interclasare.cpp:39:19: error: 'c' was not declared in this scope v[st+i-1]=c[i]; ^ interclasare.cpp: In function 'int main()': interclasare.cpp:44:7: error: 'n' was not declared in this scope f>>n; ^ interclasare.cpp:45:8: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ interclasare.cpp:46:8: error: 'a' was not declared in this scope f>>a[i]; ^ interclasare.cpp:47:7: error: 'm' was not declared in this scope f>>m; ^ interclasare.cpp:48:8: error: 'i' was not declared in this scope for(i=1;i<=m;i++) ^ interclasare.cpp:49:8: error: 'b' was not declared in this scope f>>b[i]; ^ interclasare.cpp:51:8: error: 'i' was not declared in this scope for(i=1;i<=k;i++) ^ interclasare.cpp:51:15: error: 'k' was not declared in this scope for(i=1;i<=k;i++) ^ interclasare.cpp:53:11: error: 'c' was not declared in this scope g<<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ă.