基础练习 数列特征
2019-03-16 本文已影响0人
HeoLis
#include<iostream>
using namespace std;
int main(){
int n, num;
long sum = 0;
int min = 999999999;
int max = -99999999;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> num;
if(num < min)
min = num;
if(num > max)
max = num;
sum += num;
}
cout << max << endl;
cout << min << endl;
cout << sum << endl;
return 0;
}