c语言编程练习题:7-184 胎压监测
作者:yunjinqi   类别:    日期:2023-06-04 18:45:19    阅读:122 次   消耗积分:0 分    

image.png

#include <stdio.h>
int main(){
    int a,b,c,d,high,s;
    if (scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&high,&s)!=EOF){
        int arr[4]={a,b,c,d};
        int r = 0;
        int count=0;
        int max_value = 0;
        for (int j=0;j<4;j++){if (arr[j]>max_value){max_value=arr[j];}}
        for (int i=0;i<4;i++){
            if (arr[i]<high || max_value-arr[i]>s){
                r=i;
                count++;
            }
        }
        if (count==0){printf("Normal");}
        if (count==1){printf("Warning: please check #%d!",r+1);}
        if (count>=2){printf("Warning: please check all the tires!");}

    }
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/308
上一篇:c语言编程练习题:7-183 调和平均
下一篇:c语言编程练习题:7-185 吃火锅