ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 24.01.2023 06:03:46
ამოცანა: საქანელა
მომხმარებელი: i_tulashvili2
ვერდიქტი: ამოუხსნელი
შეფასება: 0 ქულა
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int min = INT_MAX, max = INT_MIN, diff = 0; for (int i = 0; i < 4; i++) { int tmp; cin >> tmp; if (tmp < min) { min = tmp; } if (tmp > max) { max = tmp; } diff += tmp; } cout << abs(diff - (min + max)*2); return 0; }
main.cpp: In function 'int main()': main.cpp:9:12: error: 'INT_MAX' was not declared in this scope int min = INT_MAX, max = INT_MIN, diff = 0; ^~~~~~~ main.cpp:18:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' if (tmp > max) ~~~~^~~~~ main.cpp:20:10: error: overloaded function with no contextual type information max = tmp; ^~~ main.cpp:22:3: error: 'diff' was not declared in this scope diff += tmp; ^~~~ main.cpp:24:14: error: 'diff' was not declared in this scope cout << abs(diff - (min + max)*2); ^~~~ main.cpp:24:26: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+' cout << abs(diff - (min + max)*2); ~~~~^~~~~