c语言编程练习题:7-119 我是升旗手
作者:yunjinqi   类别:    日期:2023-05-31 16:29:03    阅读:131 次   消耗积分:0 分    

image.png

#include <stdio.h>
int main(){
    int n;
    int max_height=0;
    int height;
    if (scanf("%d",&n)!=EOF){
        for (int i=0;i<n;i++){
            if (scanf("%d",&height)!=EOF){
                if (i==0){max_height=height;}
                if (height>max_height){max_height=height;}
            }
        }
        printf("%d",max_height);
    }
    else{
        printf("input wrong");
    }
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/244
上一篇:c语言编程练习题:7-118 分队列
下一篇:c语言编程练习题:7-120 兔子繁殖问题