#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 | #64924254 | Utilizator | |
| Fișier | maxmin.cpp | Dimensiune | 388 B |
| Data încărcării | 14 Iunie 2026, 16:17 | 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:7:12: error: expected ‘;’ before ‘cout’ 7 | mm=a-c | ^ | ; 8 | cout << mm; | ~~~~ 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:10:12: error: expected ‘;’ before ‘cout’ 10 | mm=b-a | ^ | ; 11 | cout << mm; | ~~~~ 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:13:12: error: expected ‘;’ before ‘cout’ 13 | mm=c-b | ^ | ; 14 | cout << mm; | ~~~~ 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:16:12: error: expected ‘;’ before ‘cout’ 16 | mm=c-a | ^ | ; 17 | cout << mm; | ~~~~ 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:19:12: error: expected ‘;’ before ‘cout’ 19 | mm=a-b | ^ | ; 20 | cout << mm; | ~~~~ 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:22:12: error: expected ‘;’ before ‘return’ 22 | mm=b-c | ^ | ; 23 | return 0; | ~~~~~~
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ă.