#346
MaxAndAp
Să se scrie un program care citește un șir de n
numere naturale şi determină valoarea maximă din șir și de câte ori apare.
Problema | MaxAndAp | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50592884 | Utilizator | |
Fișier | maxandap.cpp | Dimensiune | 386 B |
Data încărcării | 16 Aprilie 2024, 13:23 | Scor / rezultat | Eroare de compilare |
maxandap.cpp: In function 'int main()': maxandap.cpp:9:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=n,i++) ^ maxandap.cpp:9:21: error: expected ';' before ')' token for(i=1,i<=n,i++) ^ maxandap.cpp:23:1: error: expected primary-expression at end of input } ^ maxandap.cpp:23:1: error: expected ';' at end of input maxandap.cpp:23:1: error: expected primary-expression at end of input maxandap.cpp:23:1: error: expected ')' at end of input maxandap.cpp:23:1: error: expected statement at end of input maxandap.cpp:5:11: warning: unused variable 'nr' [-Wunused-variable] int n,nr,maxim,ap,i; ^ maxandap.cpp:23:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MaxAndAp 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ă.