#512
SortMax
Se dă un vector cu n
elemente, numere naturale distincte. Ordonați crescător elementele situate înaintea valorii maxime din vector și descrescător elementele situate după această valoare.
Problema | SortMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22367717 | Utilizator | |
Fișier | sortmax.cpp | Dimensiune | 792 B |
Data încărcării | 06 Aprilie 2020, 22:21 | Scor / rezultat | Eroare de compilare |
sortmax.cpp:11:1: error: stray '\302' in program cout << "n= "; cin >> n; ^ sortmax.cpp:11:1: error: stray '\240' in program sortmax.cpp:11:1: error: stray '\302' in program sortmax.cpp:11:1: error: stray '\240' in program sortmax.cpp:13:1: error: stray '\302' in program cout << "introdu " << n << " numere naturale distincte: " << endl; ^ sortmax.cpp:13:1: error: stray '\240' in program sortmax.cpp:13:1: error: stray '\302' in program sortmax.cpp:13:1: error: stray '\240' in program sortmax.cpp:15:1: error: stray '\302' in program cin >> v[1]; emax=v[1]; imax=1; ^ sortmax.cpp:15:1: error: stray '\240' in program sortmax.cpp:15:1: error: stray '\302' in program sortmax.cpp:15:1: error: stray '\240' in program sortmax.cpp:17:1: error: stray '\302' in program for (i=2; i<=n; ++i) ^ sortmax.cpp:17:1: error: stray '\240' in program sortmax.cpp:17:1: error: stray '\302' in program sortmax.cpp:17:1: error: stray '\240' in program sortmax.cpp:19:1: error: stray '\302' in program { ^ sortmax.cpp:19:1: error: stray '\240' in program sortmax.cpp:19:1: error: stray '\302' in program sortmax.cpp:19:1: error: stray '\240' in program sortmax.cpp:21:1: error: stray '\302' in program cin >> v[i]; ^ sortmax.cpp:21:1: error: stray '\240' in program sortmax.cpp:21:1: error: stray '\302' in program sortmax.cpp:21:1: error: stray '\240' in program sortmax.cpp:21:1: error: stray '\302' in program sortmax.cpp:21:1: error: stray '\240' in program sortmax.cpp:21:1: error: stray '\302' in program sortmax.cpp:21:1: error: stray '\240' in program sortmax.cpp:23:1: error: stray '\302' in program if (v[i]>emax) { emax=v[i]; imax=i; } ^ sortmax.cpp:23:1: error: stray '\240' in program sortmax.cpp:23:1: error: stray '\302' in program sortmax.cpp:23:1: error: stray '\240' in program sortmax.cpp:23:1: error: stray '\302' in program sortmax.cpp:23:1: error: stray '\240' in program sortmax.cpp:23:1: error: stray '\302' in program sortmax.cpp:23:1: error: stray '\240' in program sortmax.cpp:25:1: error: stray '\302' in program } ^ sortmax.cpp:25:1: error: stray '\240' in program sortmax.cpp:25:1: error: stray '\302' in program sortmax.cpp:25:1: error: stray '\240' in program sortmax.cpp:27:1: error: stray '\302' in program for (i=1; i<imax; ++i) ^ sortmax.cpp:27:1: error: stray '\240' in program sortmax.cpp:29:1: error: stray '\302' in program { ^ sortmax.cpp:29:1: error: stray '\240' in program sortmax.cpp:29:1: error: stray '\302' in program sortmax.cpp:29:1: error: stray '\240' in program sortmax.cpp:31:1: error: stray '\302' in program for (j=i+1; j<=imax; ++j) ^ sortmax.cpp:31:1: error: stray '\240' in program sortmax.cpp:31:1: error: stray '\302' in program sortmax.cpp:31:1: error: stray '\240' in program sortmax.cpp:31:1: error: stray '\302' in program sortmax.cpp:31:1: error: stray '\240' in program sortmax.cpp:31:1: error: stray '\302' in program sortmax.cpp:31:1: error: stray '\240' in program sortmax.cpp:33:1: error: stray '\302' in program if (v[j]<v[i]) ^ sortmax.cpp:33:1: error: stray '\240' in program sortmax.cpp:33:1: error: stray '\302' in program sortmax.cpp:33:1: error: stray '\240' in program sortmax.cpp:33:1: error: stray '\302' in program sortmax.cpp:33:1: error: stray '\240' in program sortmax.cpp:33:1: error: stray '\302' in program sortmax.cpp:33:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program { int t=v[i]; v[i]=v[j]; v[j]=t; } ^ sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:35:1: error: stray '\302' in program sortmax.cpp:35:1: error: stray '\240' in program sortmax.cpp:37:1: error: stray '\302' in program } ^ sortmax.cpp:37:1: error: stray '\240' in program sortmax.cpp:37:1: error: stray '\302' in program sortmax.cpp:37:1: error: stray '\240' in program sortmax.cpp:39:1: error: stray '\302' in program for (i=imax+1; i<n; ++i) ^ sortmax.cpp:39:1: error: stray '\240' in program sortmax.cpp:39:1: error: stray '\302' in program sortmax.cpp:39:1: error: stray '\240' in program sortmax.cpp:41:1: error: stray '\302' in program { ^ sortmax.cpp:41:1: error: stray '\240' in program sortmax.cpp:41:1: error: stray '\302' in program sortmax.cpp:41:1: error: stray '\240' in program sortmax.cpp:43:1: error: stray '\302' in program for (j=i+1; j<=n; ++j) ^ sortmax.cpp:43:1: error: stray '\240' in program sortmax.cpp:43:1: error: stray '\302' in program sortmax.cpp:43:1: error: stray '\240' in program sortmax.cpp:43:1: error: stray '\302' in program sortmax.cpp:43:1: error: stray '\240' in program sortmax.cpp:43:1: error: stray '\302' in program sortmax.cpp:43:1: error: stray '\240' in program sortmax.cpp:45:1: error: stray '\302' in program if (v[j]>v[i]) ^ sortmax.cpp:45:1: error: stray '\240' in program sortmax.cpp:45:1: error: stray '\302' in program sortmax.cpp:45:1: error: stray '\240' in program sortmax.cpp:45:1: error: stray '\302' in program sortmax.cpp:45:1: error: stray '\240' in program sortmax.cpp:45:1: error: stray '\302' in program sortmax.cpp:45:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program { int t=v[i]; v[i]=v[j]; v[j]=t; } ^ sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:47:1: error: stray '\302' in program sortmax.cpp:47:1: error: stray '\240' in program sortmax.cpp:49:1: error: stray '\302' in program } ^ sortmax.cpp:49:1: error: stray '\240' in program sortmax.cpp:49:1: error: stray '\302' in program sortmax.cpp:49:1: error: stray '\240' in program sortmax.cpp:51:1: error: stray '\302' in program for (i=1; i<=n; ++i) ^ sortmax.cpp:51:1: error: stray '\240' in program sortmax.cpp:51:1: error: stray '\302' in program sortmax.cpp:51:1: error: stray '\240' in program sortmax.cpp:53:1: error: stray '\302' in program cout << v[i] << " "; ^ sortmax.cpp:53:1: error: stray '\240' in program sortmax.cpp:53:1: error: stray '\302' in program sortmax.cpp:53:1: error: stray '\240' in program sortmax.cpp:53:1: error: stray '\302' in program sortmax.cpp:53:1: error: stray '\240' in program sortmax.cpp:53:1: error: stray '\302' in program sortmax.cpp:53:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortMax 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ă.