HDU-1037 Keep on Truckin'

简介: HDU-1037 Keep on Truckin'

题目:

description:

Boudreaux and Thibodeaux are on the road again …

“Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by tonight!”

“Don’t worry, Thibodeaux, I already checked ahead. There are three  underpasses and our 18-wheeler will fit through all of them, so just  keep that motor running!”

“We’re not going to make it, I say!”

So, which is it: will there be a very messy accident on Interstate  10, or is Thibodeaux just letting the sound of his own wheels drive him  crazy?

Input:

Input to this problem will consist of a single data set. The data set will be formatted according to the following description.

The data set will consist of a single line containing 3 numbers,  separated by single spaces. Each number represents the height of a  single underpass in inches. Each number will be between 0 and 300  inclusive.

Output:

There will be exactly one line of output. This line will be:

NO CRASH

if the height of the 18-wheeler is less than the height of each of the underpasses, or:

CRASH X

otherwise, where X is the height of the first underpass in the data  set that the 18-wheeler is unable to go under (which means its height is  less than or equal to the height of the 18-wheeler). The height of the  18-wheeler is 168 inches.

Sample Input

180 160 170

Sample Output

CRASH 160

解析:

1. 题目,地底隧道的最低高度是否满足要求

#include<stdio.h>
int main(){
   int a[3],min;
   while(scanf("%d %d %d",&a[0],&a[1],&a[2])!=EOF)
   {
       min=a[0];
       for(int i=0;i<3;i++)
       {
           if(min>a[i])
           {
               min=a[i];
           }
       }
       if(min<168)
       {
           printf("CRASH %d\n",min);
       }
       else
       {
            printf("NO CRASH\n");
       }
   }
   return 0;
}


相关文章
|
5月前
|
XML JSON API
手把手教你调用京东商品详情 API:从申请到数据抓取全流程
京东商品详情API为电商从业者、分析师及开发者提供高效数据支持,助力优化业务与研究。该接口具备丰富数据(商品属性、价格、描述、图片、评价等)与灵活请求方式(GET/POST),满足多样化需求,是数字化时代电商应用开发与分析的有力工具。
364 13
|
存储 监控 安全
数据库数据的保密性
【4月更文挑战第9天】数据库保密性关键在于限制未授权访问和保护数据不泄露。措施包括访问控制、加密、数据脱敏、备份恢复、审计监控及安全配置等,确保数据安全和用户隐私。
289 2
|
5月前
|
弹性计算 运维 自动驾驶
首个云超算国标正式发布!
近日,我国首个云超算国家标准GB/T 45400-2025正式发布,将于今年10月实施。该标准由阿里云联合多家机构起草,为云超算在高性能计算领域的应用提供规范。云超算结合传统HPC与云计算优势,解决传统HPC复杂、昂贵等问题。阿里云E-HPC V2.0是国内首批通过该标准认证的产品,支持大规模弹性计算,显著降低成本。新标准将推动算力基础设施迈向标准化、智能化新时代。
|
10月前
|
前端开发 JavaScript API
前端:事件循环/异步
前端开发中的事件循环和异步处理是核心机制,用于管理任务执行、性能优化及响应用户操作,确保网页流畅运行。事件循环负责调度任务,而异步则通过回调、Promise等实现非阻塞操作。
|
7月前
|
人工智能 自然语言处理 程序员
开测: AI智能编码辅助工具通义灵码V2.0 来了
通义灵码2.0是阿里云推出的AI编程助手,基于DeepSeek大模型进行快速迭代,显著提升了代码生成、多任务协作和模型性能。
368 12
开测: AI智能编码辅助工具通义灵码V2.0 来了
|
11月前
|
存储 安全 关系型数据库
后端技术深度剖析:构建高效稳定的企业级应用
【10月更文挑战第5天】后端技术深度剖析:构建高效稳定的企业级应用
220 0
|
10月前
|
存储 前端开发 搜索推荐
ClkLog基于ClickHouse 的百万日活实测报告
自 ClkLog 上线以来,我们不断吸纳用户需求,提升产品的支持能力。今年下半年,我们遇到了日活跃用户数达到百万级别的客户。为了给 ClkLog 用户提供可靠的技术建议和解决方案,同时也为了节省成本,在Clickhouse官方支持下,我们在阿里云上对 ClickHouse 社区版、企业版进行了详细测试和成本分析。
|
JavaScript API 开发工具
记一次后台管理脚手架选型过程
面对大屏支持不足的vue移动端项目,业务部门要求改进。原项目优化困难,决定重构。选型阶段,因业务类似后台管理,选择vue框架。在git和gitee上对比了两款脚手架,最终选定[ pure-admin-thin ](https://github.com/pure-admin/pure-admin-thin)因其频繁更新、先进框架和丰富文档。选型关键在于资料易得性、框架时效性和维护者信誉。欢迎评论区提供反馈和建议。
302 1
|
人工智能 自然语言处理 搜索推荐
|
SQL NoSQL Java
【项目场景】如何保证接口的幂等性?
【项目场景】如何保证接口的幂等性?
557 0

热门文章

最新文章