多遍历几下
2024-08-17 13:21:00
发布于:云南
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int cha[9];
int main(){
for(int i = 1;i <= 8;i++){
int maxx = -1,minx = 0x3f3f3f3f;
for(int j = 1;j <= 3;j++){
int t; cin >> t;
maxx = max(maxx,t);
minx = min(minx,t);
}
cha[i] = maxx - minx;
}
int maxn = -1,minn = 0x3f3f3f3f;
for(int i = 1;i <= 8;i++){
maxn = max(maxn,cha[i]);
minn = min(minn,cha[i]);
}
int S_index = maxn - minn;
cout << S_index;
return 0;
}
这里空空如也
有帮助,赞一个