#include <iostream>
using namespace std;
int main() {
int n, temp;
cin >> n;
int a[10000];
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (a[j] > a[j + 1]) {
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
cout << a[n - 1] << endl;
cout << a[0] << endl;
cout << sum << endl;
return 0;
}
11-13
445
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-16
11-01
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交