解题思路:思路也简单,找出最大值即可
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int n;
while(scanf("%d",&n) && n){
int b[n],t;
for(int i = 0;i<n;i++){
scanf("%d",&b[i]);
}
for(int i = 0;i<n-1;i++){
for(int j = i+1;j<n;j++){
if(b[j] >b[i]){
t = b[j];
b[j] = b[i];
b[i] = t;
}
}
}
printf("%d\n",b[0]);
}
return 0;
}
0.0分
0 人评分