#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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64924271 | Utilizator | |
| Fișier | maxmin.cpp | Dimensiune | 483 B |
| Data încărcării | 14 Iunie 2026, 16:20 | Scor/rezultat | Eroare de compilare |
maxmin.cpp: In function ‘int main()’: maxmin.cpp:6:7: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 6 | if (a>=b>=c) | ~^~~ maxmin.cpp:6:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 6 | if (a>=b>=c) | ^~ maxmin.cpp:8:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 8 | cout << mm; | ^~~~ maxmin.cpp:9:2: error: ‘else’ without a previous ‘if’ 9 | else {if (b>=c>=a) | ^~~~ maxmin.cpp:9:13: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 9 | else {if (b>=c>=a) | ~^~~ maxmin.cpp:13:2: error: ‘else’ without a previous ‘if’ 13 | else {if (c>=a>=b) | ^~~~ maxmin.cpp:13:13: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 13 | else {if (c>=a>=b) | ~^~~ maxmin.cpp:17:2: error: ‘else’ without a previous ‘if’ 17 | else if {(c>=b>=a) | ^~~~ maxmin.cpp:17:10: error: expected ‘(’ before ‘{’ token 17 | else if {(c>=b>=a) | ^ | ( maxmin.cpp:21:2: error: ‘else’ without a previous ‘if’ 21 | else if {(a>=c>=b) | ^~~~ maxmin.cpp:21:10: error: expected ‘(’ before ‘{’ token 21 | else if {(a>=c>=b) | ^ | ( maxmin.cpp:25:2: error: ‘else’ without a previous ‘if’ 25 | else if{ (b>=a>=c) | ^~~~ maxmin.cpp:25:9: error: expected ‘(’ before ‘{’ token 25 | else if{ (b>=a>=c) | ^ | (
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ă.