为什么错啊,只有30分
查看原帖
为什么错啊,只有30分
1050915
YX_Z_00楼主2023/9/15 15:18
#include<iostream>
using namespace std;
#define N 1000000

int main()
{
	long long n, i ,a[N];
	cin >> n;
	long long max = 0,min;
	for (i = 0; i < n; i++)
	{
		if (i == 0)
			min = a[i];
		cin >> a[i];
		if (a[i] > max) max = a[i];
		if (a[i] < min) min = a[i];
	}
	for ( i = 0; i < n; i++)
		cout << max - a[i] << " ";
	cout << endl;
	for ( i = 0; i < n; i++)
		cout << a[i] - min << " ";
	return 0;
}
2023/9/15 15:18
加载中...