#3980
Se citește un număr natural nenul n
și apoi se citesc n
numere naturale. Calculați suma dintre valoarea minimă și valoarea maximă.
Problema | MinPlusMax | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56780553 | Utilizator | |
Fișier | minplusmax.cpp | Dimensiune | 315 B |
Data încărcării | 05 Martie 2025, 16:49 | Scor / rezultat | Eroare de compilare |
minplusmax.cpp: In function 'int main()': minplusmax.cpp:5:27: error: left operand of comma operator cannot resolve address of overloaded function int n, valoare; min, max; ^ minplusmax.cpp:5:27: error: no context to resolve type of 'std::max' minplusmax.cpp:10:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>' for(min>valoare) ^ minplusmax.cpp:10:21: error: expected ';' before ')' token for(min>valoare) ^ minplusmax.cpp:12:6: error: expected primary-expression before 'for' for (max<valoare) ^ minplusmax.cpp:12:6: error: expected ';' before 'for' minplusmax.cpp:12:6: error: expected primary-expression before 'for' minplusmax.cpp:12:6: error: expected ')' before 'for' minplusmax.cpp:12:15: error: the value of 'valoare' is not usable in a constant expression for (max<valoare) ^ minplusmax.cpp:5:13: note: 'int valoare' is not const int n, valoare; min, max; ^ minplusmax.cpp:12:11: error: parse error in template argument list for (max<valoare) ^ minplusmax.cpp:12:22: error: expected ';' before ')' token for (max<valoare) ^ minplusmax.cpp:13:19: error: statement cannot resolve address of overloaded function {max=valoare;} ^ minplusmax.cpp:14:5: error: expected primary-expression before '}' token } ^ minplusmax.cpp:14:5: error: expected ';' before '}' token minplusmax.cpp:14:5: error: expected primary-expression before '}' token minplusmax.cpp:14:5: error: expected ')' before '}' token minplusmax.cpp:14:5: error: expected primary-expression before '}' token minplusmax.cpp:14:5: error: expected ';' before '}' token minplusmax.cpp:15:5: error: 's' was not declared in this scope s=max+min; ^ minplusmax.cpp:15:11: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator+' s=max+min; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MinPlusMax 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ă.