#4151
Se citește un vector cu n
elemente, numere naturale distincte. Să se afișeze elementele cuprinse între elementul cu valoarea minimă și cel cu valoare maximă din vector, inclusiv acestea.
Problema | AMM | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52751949 | Utilizator | |
Fișier | amm.cpp | Dimensiune | 349 B |
Data încărcării | 08 Octombrie 2024, 17:01 | Scor / rezultat | Eroare de compilare |
amm.cpp: In function 'int main()': amm.cpp:5:5: error: 'cin' was not declared in this scope cin>>n; ^ amm.cpp:5:5: note: suggested alternative: In file included from amm.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ amm.cpp:6:16: warning: right operand of comma operator has no effect [-Wunused-value] for (i=1, i<=n, i++) ^ amm.cpp:6:24: error: expected ';' before ')' token for (i=1, i<=n, i++) ^ amm.cpp:8:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] min=v[1]; ^ amm.cpp:9:13: error: expected ')' before ';' token max=v[1]; ^ amm.cpp:10:16: warning: right operand of comma operator has no effect [-Wunused-value] for (i=1, i<=n, i++) ^ amm.cpp:10:24: error: expected ';' before ')' token for (i=1, i<=n, i++) ^ amm.cpp:14:5: error: expected primary-expression before 'for' for (i=1, i<=n, i++) ^ amm.cpp:14:5: error: expected ';' before 'for' amm.cpp:14:5: error: expected primary-expression before 'for' amm.cpp:14:5: error: expected ')' before 'for' amm.cpp:14:16: warning: right operand of comma operator has no effect [-Wunused-value] for (i=1, i<=n, i++) ^ amm.cpp:14:24: error: expected ';' before ')' token for (i=1, i<=n, i++) ^ amm.cpp:17:5: error: expected primary-expression before 'return' return 0; ^ amm.cpp:17:5: error: expected ';' before 'return' amm.cpp:17:5: error: expected primary-expression before 'return' amm.cpp:17:5: error: expected ')' before 'return'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AMM 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ă.