#include<stdio.h>
int main() {
int n = 0;
scanf_s("%d", &n);
int arr[50] = { 0 };
int i = 0;
int max = 0;
for (i = 0; i <n; i++) {
scanf_s("%d",&arr[i]);
if (arr[i] > max) {
max = arr[i];
}
}
printf("%d\n",max);
}
输入一组数据,将0设为max,数组循环比较与0;得出最大值
输出max