#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 | #57869184 | Utilizator | |
Fișier | pozmax.cpp | Dimensiune | 515 B |
Data încărcării | 28 Aprilie 2025, 14:01 | Scor / rezultat | Eroare de compilare |
pozmax.cpp:6:1: error: expected ',' or ';' before 'ofstream' ofstream g("maximpar.out") ^ pozmax.cpp: In function 'int main()': pozmax.cpp:10:8: error: 'n' was not declared in this scope f>>n; ^ pozmax.cpp:11:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ pozmax.cpp:12:14: error: 'a' was not declared in this scope cin>>a[i]; ^ pozmax.cpp:13:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ pozmax.cpp:14:12: error: 'a' was not declared in this scope if(a[i]>maxim) ^ pozmax.cpp:14:17: error: 'maxim' was not declared in this scope if(a[i]>maxim) ^ pozmax.cpp:16:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ pozmax.cpp:17:12: error: 'a' was not declared in this scope if(a[i]==maxim&&x=2) ^ pozmax.cpp:17:18: error: 'maxim' was not declared in this scope if(a[i]==maxim&&x=2) ^ pozmax.cpp:17:25: error: 'x' was not declared in this scope if(a[i]==maxim&&x=2) ^ pozmax.cpp:20:13: error: 'y' was not declared in this scope y=i; ^ pozmax.cpp:22:9: error: 'i' was not declared in this scope for(i=n;i>=1;i--) ^ pozmax.cpp:23:12: error: 'a' was not declared in this scope if(a[i]==maxim&&x=1;) ^ pozmax.cpp:23:18: error: 'maxim' was not declared in this scope if(a[i]==maxim&&x=1;) ^ pozmax.cpp:23:25: error: 'x' was not declared in this scope if(a[i]==maxim&&x=1;) ^ pozmax.cpp:23:28: error: expected ')' before ';' token if(a[i]==maxim&&x=1;) ^ pozmax.cpp:23:29: error: expected primary-expression before ')' token if(a[i]==maxim&&x=1;) ^ pozmax.cpp:23:29: error: expected ';' before ')' token pozmax.cpp:26:11: error: 'y' was not declared in this scope cout<<y<<" "<<z; ^ pozmax.cpp:26:19: error: 'z' was not declared in this scope cout<<y<<" "<<z; ^
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ă.