1089 -- 寻找幸运数
来源:互联网 发布:淘宝天猫评价提取工具 编辑:程序博客网 时间:2024/06/05 02:52
寻找幸运数
Time Limit:1000MS Memory Limit:65536K
Total Submit:306 Accepted:138
Description
给定三个整数(0≤A1,A2,A3≤10000),请找出第一个不大于168的数。如果存在该数,输出"CRASH"并空一格输出该数,否则输出"NO CRASH"。遇到A1=A2=A3=-1则运行结束。
Input
Output
Sample Input
180 160 170169 170 200-1 -1 -1
Sample Output
CRASH 160NO CRASH
Source
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AK1089 { class Program { static void Main(string[] args) { string s; while ((s = Console.ReadLine()) != null) { string[] sb = s.Split(); int a = int.Parse(sb[0]), b = int.Parse(sb[1]), c = int.Parse(sb[2]); if (a + b + c == -3) break; else { bool flag = false; if (a <= 168) { flag = true; Console.WriteLine("CRASH {0}", a); } if (!flag && b <= 168) { flag = true; Console.WriteLine("CRASH {0}", b); } if (!flag && c <= 168) { flag = true; Console.WriteLine("CRASH {0}", c); } if (!flag) Console.WriteLine("NO CRASH"); } } } } }
0 0
- 1089 -- 寻找幸运数
- 寻找幸运数
- 1266: 寻找幸运数
- 寻找幸运数
- 1266:寻找幸运数
- 在线编程:幸运数--前奏--寻找质数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 幸运数
- 统计学中常见的英文缩写
- 1088 -- 输出二叉树
- 文章标题
- C 面试题选(一)
- VC++6.0的那点事儿
- 1089 -- 寻找幸运数
- python 有关super
- Ubuntu 源码安装 odoo 8.0
- 多客户端服务器网络编程
- 1090 -- 简单编码
- restClient图解
- 1091 -- 逆反A*B
- Python week0
- Windows 2003密码重置