#282
Se dă un şir cu n elemente, numere reale, numerotate de la 1 la n. Determinaţi numărul de ordine al primei şi al ultimei apariţii a valorii maxime din şir.
| Problema | PozMax | Operații I/O |
pozmax.in/pozmax.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
| Id soluție | #64798559 | Utilizator | |
| Fișier | pozmax.cpp | Dimensiune | 446 B |
| Data încărcării | 02 Iunie 2026, 09:27 | Scor/rezultat | Eroare de compilare |
pozmax.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream fin ("pozmax.in"); | ^~~~~~~~ pozmax.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream fout ("pozmax.out"); | ^~~~~~~~ pozmax.cpp:6:7: error: expected nested-name-specifier before ‘double’ 6 | using double x, maxi; | ^~~~~~ pozmax.cpp: In function ‘int main()’: pozmax.cpp:12:5: error: ‘fin’ was not declared in this scope 12 | fin>>n; | ^~~ pozmax.cpp:13:10: error: ‘x’ was not declared in this scope 13 | fin>>x; | ^ pozmax.cpp:14:5: error: ‘maxi’ was not declared in this scope 14 | maxi=x; | ^~~~ pozmax.cpp:23:5: error: ‘else’ without a previous ‘if’ 23 | else if (x==maxi) | ^~~~ pozmax.cpp: At global scope: pozmax.cpp:27:5: error: ‘fout’ does not name a type 27 | fout<< poz1<< " "<< poz2; | ^~~~ pozmax.cpp:28:1: error: expected declaration before ‘}’ token 28 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMax 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ă.