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
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;
}


相关文章
|
Linux iOS开发 MacOS
typora下载和破解(仅供学习)
Typora 一款 Markdown 编辑器和阅读器 风格极简 / 多种主题 / 支持 macOS,Windows 及 Linux 实时预览 / 图片与文字 / 代码块 / 数学公式 / 图表 目录大纲 / 文件管理 / 导入与导出 ……
163140 11
typora下载和破解(仅供学习)
|
11月前
|
设计模式 安全 Java
Java编程中的单例模式:理解与实践
【10月更文挑战第31天】在Java的世界里,单例模式是一种优雅的解决方案,它确保一个类只有一个实例,并提供一个全局访问点。本文将深入探讨单例模式的实现方式、使用场景及其优缺点,同时提供代码示例以加深理解。无论你是Java新手还是有经验的开发者,掌握单例模式都将是你技能库中的宝贵财富。
328 2
|
存储 安全 Ubuntu
Android 生成平台应用签名keystore文件
Android 生成平台应用签名keystore文件
444 0
|
API Python Windows
ChartGPT API是一个基于Websocket的API
ChartGPT API是一个基于Websocket的API
319 1
java初中级面试题(SSM+Mysql+微服务(SpringCloud+Dubbo)+消息队列(RocketMQ)+缓存(Redis+MongoDB)+设计模式+搜索引擎(ES)+JVM
java初中级面试题(SSM+Mysql+微服务(SpringCloud+Dubbo)+消息队列(RocketMQ)+缓存(Redis+MongoDB)+设计模式+搜索引擎(ES)+JVM
644 0
|
传感器 机器学习/深度学习 人工智能
未来AI技术的发展与应用
人工智能(AI)技术正日益成为当今世界的热门话题,其在各个领域的应用正在不断拓展。本文将探讨未来AI技术的发展趋势,并重点分析其在医疗、交通、教育和环境保护等领域的应用前景,揭示人工智能技术对我们生活的深远影响。
|
监控 Devops 中间件
测试环境不稳定&复杂的必然性及其对策
为什么测试环境的不稳定是必然的,怎么让它尽量稳定一点?为什么测试环境比生产环境更复杂,怎么让它尽量简单一点?本文将就这两点进行分享。同时,还会谈一谈对测试环境和生产环境的区别的理解。
测试环境不稳定&复杂的必然性及其对策
|
Web App开发 算法 安全
部署国密SSL证书,如何兼容国际主流浏览器?
实现基于国密算法的HTTPS加密认证,最大的应用难点在于,国密算法应用生态的建设以及对主流应用生态的兼容。
7366 0
|
网络协议 Java Linux
Netty实战与源码剖析(一)——浅谈NIO编程
Netty实战与源码剖析(一)——浅谈NIO编程
514 0
Netty实战与源码剖析(一)——浅谈NIO编程