#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 | #64924262 | Utilizator | |
| Fișier | maxmin.cpp | Dimensiune | 424 B |
| Data încărcării | 14 Iunie 2026, 16:18 | 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:12: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 9 | else if (b>=c>=a) | ~^~~ maxmin.cpp:9:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 9 | else if (b>=c>=a) | ^~ maxmin.cpp:11:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 11 | cout << mm; | ^~~~ maxmin.cpp:12:2: error: ‘else’ without a previous ‘if’ 12 | else if (c>=a>=b) | ^~~~ maxmin.cpp:12:12: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 12 | else if (c>=a>=b) | ~^~~ maxmin.cpp:12:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 12 | else if (c>=a>=b) | ^~ maxmin.cpp:14:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 14 | cout << mm; | ^~~~ maxmin.cpp:15:2: error: ‘else’ without a previous ‘if’ 15 | else if (c>=b>=a) | ^~~~ maxmin.cpp:15:12: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 15 | else if (c>=b>=a) | ~^~~ maxmin.cpp:15:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | else if (c>=b>=a) | ^~ maxmin.cpp:17:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 17 | cout << mm; | ^~~~ maxmin.cpp:18:2: error: ‘else’ without a previous ‘if’ 18 | else if (a>=c>=b) | ^~~~ maxmin.cpp:18:12: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 18 | else if (a>=c>=b) | ~^~~ maxmin.cpp:18:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 18 | else if (a>=c>=b) | ^~ maxmin.cpp:20:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 20 | cout << mm; | ^~~~ maxmin.cpp:21:2: error: ‘else’ without a previous ‘if’ 21 | else if (b>=a>=c) | ^~~~ maxmin.cpp:21:12: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 21 | else if (b>=a>=c) | ~^~~ maxmin.cpp:21:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 21 | else if (b>=a>=c) | ^~ maxmin.cpp:23:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 23 | cout << mm; | ^~~~
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ă.