#9
maxmin
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 | #53969913 | Utilizator | |
Fișier | maxmin.cpp | Dimensiune | 285 B |
Data încărcării | 16 Noiembrie 2024, 11:54 | Scor / rezultat | Eroare de compilare |
maxmin.cpp:1:10: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ maxmin.cpp: In function 'int main()': maxmin.cpp:6:1: error: 'cin' was not declared in this scope cin >> a; ^ maxmin.cpp:6:6: error: 'gt' was not declared in this scope cin >> a; ^ maxmin.cpp:6:15: warning: statement has no effect [-Wunused-value] cin >> a; ^ maxmin.cpp:7:15: warning: statement has no effect [-Wunused-value] cin >> b; ^ maxmin.cpp:8:15: warning: statement has no effect [-Wunused-value] cin >> c; ^ maxmin.cpp:10:9: error: expected ')' before ';' token if (b>max) ^ maxmin.cpp:10:13: error: expected ';' before ')' token if (b>max) ^ maxmin.cpp:11:6: warning: statement has no effect [-Wunused-value] max=b; ^ maxmin.cpp:12:9: error: expected ')' before ';' token if (c>max) ^ maxmin.cpp:12:13: error: expected ';' before ')' token if (c>max) ^ maxmin.cpp:13:6: warning: statement has no effect [-Wunused-value] max=c; ^ maxmin.cpp:15:7: error: 'lt' was not declared in this scope if (b<min) ^ maxmin.cpp:15:9: error: expected ')' before ';' token if (b<min) ^ maxmin.cpp:15:13: error: expected ';' before ')' token if (b<min) ^ maxmin.cpp:16:6: warning: statement has no effect [-Wunused-value] min=b; ^ maxmin.cpp:17:7: error: 'lt' was not declared in this scope if (c<min) ^ maxmin.cpp:17:9: error: expected ')' before ';' token if (c<min) ^ maxmin.cpp:17:13: error: expected ';' before ')' token if (c<min) ^ maxmin.cpp:18:6: warning: statement has no effect [-Wunused-value] min=c; ^ maxmin.cpp:19:1: error: 'cout' was not declared in this scope cout << max-min<< endl; ^ maxmin.cpp:19:7: error: 'lt' was not declared in this scope cout << max-min<< endl; ^ maxmin.cpp:19:31: error: 'endl' was not declared in this scope 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ă.