当前位置:网站首页>L1-069 tire pressure monitoring (15 points)
L1-069 tire pressure monitoring (15 points)
2022-06-10 16:47:00 【Liabilities between persons^】
L1-069 Tire pressure monitoring (15 branch )
There is a system in the car to monitor the tire pressure of four wheels at any time , If the four tire pressures are not very balanced , It may have a serious impact on the driving .

Let's put four wheels —— Left front wheel 、 Right front wheel 、 Right rear wheel 、 Left rear wheel —— The serial number is 1、2、3、4. Please write a monitoring program , Monitor the tire pressure of the four wheels at any time , And give correct alarm information . The alarm rules are as follows :
- If the error between the pressure values of all tires and the maximum of them is within a given threshold , And the tire pressure shall not be lower than the minimum alarm tire pressure set by the system , It indicates that the situation is normal , Don't call the police ;
- If the error between the pressure value of a tire and the maximum value of them exceeds the threshold , Or lower than the minimum alarm tire pressure set by the system , Then you should not only call the police , And give the exact location of the tire that may leak ;
- If there are two or more tires, the error between the pressure value and the maximum value of them exceeds the threshold , Or lower than the minimum alarm tire pressure set by the system , The alarm requires all tires to be checked .
Input format :
Enter... On one line 6 individual [0, 400] Range of integers , In turn 1~4 The tire pressure of tire No 、 Minimum alarm tire pressure 、 And the threshold of tire pressure difference .
Output format :
The corresponding information is given according to the entered tire pressure value :
- If you don't have to call the police , Output
Normal; If a tire needs an alarm , OutputWarning: please check #X!, amongX - It's the number of the tyre in question ;
- Check all tires if necessary , Output
Warning: please check all the tires!.
sample input 1:
242 251 231 248 230 20
sample output 1:
Normal
sample input 2:
242 251 232 248 230 10
sample output 2:
Warning: please check #3!
sample input 3:
240 251 232 248 240 10
sample output 3:
Warning: please check all the tires!
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<sstream>
using namespace std;
typedef long long ll;
const int N=10010;
int main()
{
int a[4], x, y;
int maxx = 0;
for(int i = 0; i < 4; i ++ )
{
cin >> a[i];
maxx = max(a[i], maxx);
}
cin >> x >> y;
int flag = 0;
int res;
for(int i = 0; i < 4; i ++ )
{
if((maxx - a[i]) <= y && a[i] >= x)
continue;
else
{
flag ++ ;
res = i;
}
}
if(flag == 0) cout << "Normal" << endl;
else if(flag == 1) printf("Warning: please check #%d!", res + 1);
else cout << "Warning: please check all the tires!" << endl;
return 0;
}
边栏推荐
- Pytorch installation tutorial
- Android 13 re upgrade for intent filters security
- Why do I need a thread pool? What is pooling technology?
- 亦舒作品经典语句
- 圆周率 π 小数点第 100 万亿数字是多少?Google 用 Debian 服务器给出了答案
- Print linked list from end to end (6)
- Exploration of kangaroo cloud data stack on spark SQL optimization based on CBO
- Link multiple alamofire requests - chain multiple alamofire requests
- 纽约金融监管机构发布正式的稳定币指南
- 技术分享| 快对讲,全球对讲
猜你喜欢

Detailed explanation of RGB color space, hue, saturation, brightness and HSV color space

Duyuan outdoor sprint to Shenzhen Stock Exchange: the annual revenue is 350million, and the color of Lin Xizhen family is obvious

Effect comparison and code implementation of three time series hybrid modeling methods

接口测试学习笔记

Digital image processing: graying
![leetcode:730. Statistics of different palindrome subsequences [traversed by point and surface interval DP + 3D DP + diagonal]](/img/90/79c51f944709ef230f394e874aa9ac.png)
leetcode:730. Statistics of different palindrome subsequences [traversed by point and surface interval DP + 3D DP + diagonal]

Troubleshooting of cl210openstack operation -- troubleshooting of common core problems

PV operation daily question - single log bridge problem

Web2 到 Web3,意识形态也需要发生改变

Middle office: Data middle office, business middle office, technology middle office, application middle office, AI middle office
随机推荐
Devops software architecture evolution
Jerry's ble IO port interrupt and flip [chapter]
Full array of arrays
Learn actionchains through jianshu.com and Chapter 3 of selenium webdriver
The CPU load caused by implicit conversion is nearly 100%
Fiddler配置
51 timer initial value calculation
NanoMQ Newsletter 2022-05|v0.8.0 发布,新增 WebHook 拓展接口和连接认证 API
How does Dao achieve decentralized governance?
AttributeError: module ‘gym. envs. Box2d 'has no attribute' lunarlander 'solution
Web2 到 Web3,意识形态也需要发生改变
圆周率 π 小数点第 100 万亿数字是多少?Google 用 Debian 服务器给出了答案
Jerry's ble dynamic power regulation [chapter]
postman常用断言
You have a ml.net quick reference manual to check!
Enroulez - vous, brisez l'anxiété de 35 ans, l'animation montre le processeur enregistrer le processus d'appel de fonction, entrer dans l'usine d'interconnexion est si simple
Application of stop in screen program_ SAP LIUMENG_
Diagram of the quarterly report of station B: the revenue is RMB 5.1 billion, with a year-on-year increase of 30% and nearly 300million monthly active users
MM主要的表和主要字段_SAP刘梦_
数字图像处理:灰度化