#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 | #64802864 | Utilizator | |
| Fișier | maxmin.cpp | Dimensiune | 285 B |
| Data încărcării | 02 Iunie 2026, 12:34 | Scor/rezultat | 30 puncte |
maxmin.cpp: In function ‘int main()’: maxmin.cpp:9:9: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 9 | if(a>b>c) cout<< a-c; | ~^~ maxmin.cpp:10:9: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 10 | if(a>c>b) cout<< a-b; | ~^~ maxmin.cpp:11:9: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 11 | if(b>a>c) cout<< b-c; | ~^~ maxmin.cpp:12:9: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 12 | if(b>c>a) cout<< b-a; | ~^~ maxmin.cpp:13:9: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 13 | if(c>a>b) cout<< c-b; | ~^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 10 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 30 | |||||
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ă.