#include <cstdio>
typedef long long ll;
const int MAXN = 10010;
ll n, maxV = -1000000, minV = 1000000, sum = 0, number[MAXN];
int main() {
scanf("%lld",&n);
for(ll i=0; i<n; i++)
scanf("%lld",&number[i]);
for(ll i=0; i<n; i++) {
if(number[i] > maxV) maxV = number[i];
if(number[i] < minV) minV = number[i];
sum += number[i];
}
printf("%lld\n",maxV);
printf("%lld\n",minV);
printf("%lld",sum);
return 0;
}
BASIC-4 数列特征
最新推荐文章于 2024-02-17 23:05:48 发布