#9
Să se scrie un program care citeşte de la tastatură trei numere naturale și determină diferenţa dintre cel mai mare şi cel mai mic.
Problema | maxmin | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57264418 | Utilizator | |
Fișier | maxmin.cpp | Dimensiune | 295 B |
Data încărcării | 22 Martie 2025, 20:47 | Scor / rezultat | Eroare de compilare |
maxmin.cpp: In function 'int main()': maxmin.cpp:9:8: error: overloaded function with no contextual type information max=a; ^ maxmin.cpp:10:13: error: the value of 'b' is not usable in a constant expression if (max<b) ^ maxmin.cpp:7:11: note: 'int b' is not const int a,b,c; ^ maxmin.cpp:10:9: error: parse error in template argument list if (max<b) ^ maxmin.cpp:10:14: error: cannot resolve overloaded function 'max' based on conversion to type 'bool' if (max<b) ^ maxmin.cpp:11:12: error: overloaded function with no contextual type information max=b; ^ maxmin.cpp:12:13: error: the value of 'c' is not usable in a constant expression if (max<c); ^ maxmin.cpp:7:13: note: 'int c' is not const int a,b,c; ^ maxmin.cpp:12:9: error: parse error in template argument list if (max<c); ^ maxmin.cpp:12:14: error: cannot resolve overloaded function 'max' based on conversion to type 'bool' if (max<c); ^ maxmin.cpp:13:12: error: overloaded function with no contextual type information max=c; ^ maxmin.cpp:14:8: error: overloaded function with no contextual type information min=a; ^ maxmin.cpp:15:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>' if(min>b); ^ maxmin.cpp:16:11: error: overloaded function with no contextual type information min=b; ^ maxmin.cpp:17:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>' if(min>c); ^ maxmin.cpp:18:11: error: overloaded function with no contextual type information min=c; ^ maxmin.cpp:19:18: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-' cout<<max-min<<endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maxmin 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ă.