求助,只有40分
查看原帖
求助,只有40分
1494443
wdmzjhyk楼主2024/10/22 20:16
#include<stdio.h>
#include<cstdio> 
#include<algorithm>
using namespace std;
int s[1000];
int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &s[i]);
	}
	sort(s, s + n+1);
	int a, b,c;
	a = s[1];
	b = s[n];
	c = a + b;
	printf("%d", c);
	return 0;
}
2024/10/22 20:16
加载中...