题解
2024-05-15 13:17:24
发布于:广东
2阅读
0回复
0点赞
#include <iostream>
#include <cstdio>
using namespace std;
int a[100005];
int main(){
for(int i = 1; i <= 24; i++){
cin >> a[i];
}int mx = 0, mn = 0x3f3f3f3f;
for(int i = 1; i <= 22; i += 3){
int ct = max(a[i], max(a[i + 1], a[i + 2])) - min(a[i], min(a[i + 1], a[i + 2]));
mx = max(mx, ct), mn = min(mn, ct);
}cout << mx - mn;
return 0;
}
这里空空如也
有帮助,赞一个