整齐划一,一行红色,一行紫色,求助!
查看原帖
整齐划一,一行红色,一行紫色,求助!
1390743
_mei_tou_nao_楼主2024/8/11 14:35
#include <bits/stdc++.h>
using namespace std;
long long a[114514], b, c, d=9999999999999999999999999999, e, f, g, h;

int main() {
	cin >> b;
	for (int i = 1; i <= b; i++) {
		cin >> a[i];
		if (a[i] >= c) {
			c = a[i];
		}
	}
	for (int i = 1; i <= b; i++) {
		if (a[i] <= d) {
			d = a[i];
		}
	}
	for (int i = 1; i <= d; i++) {
		cout << c - a[i] << " ";
	}
	cout << endl;
	for (int i = 1; i <= d; i++) {
		cout << a[i] - d << " ";
	}
	return 0;
}
样例都没过,有关
2024/8/11 14:35
加载中...