曹冲称象
Time Limit:1000MS Memory Limit:65536K
Total Submit:122 Accepted:60
Description
曹冲是三国杀里的一名武将,他有一个叫称象的技能,每当你受到一次伤害后,你可以亮出牌堆顶的四张牌。然后获得其中任意数量点数之和小于13的牌,将其余的牌置入弃牌堆。 我们要测试看他是不是运气好。什么是运气好(⊙o⊙)? 只要他拿的拍数量多于或等于三即为运气好。
Input
多组输入每一行为四个整数(1~13)代表四张牌的点数,EOF结束
Output
输出运气好--good luck 运气坏--oh no
Sample Input
1 2 3 4
2 3 4 5
2 4 5 7
7 7 7 7
Sample Output
good luck
good luck
good luck
oh no
Source
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1197 {
class Program {
static void Main(string[] args) {
string sb;
while ((sb = Console.ReadLine()) != null) {
string[] s = sb.Split();
int[] a = new int[4];
for (int i = 0; i < 4; i++)
a[i] = int.Parse(s[i]);
Array.Sort(a, 0, 4);
if (a[0] + a[1] + a[2] < 13)
Console.WriteLine("good luck");
else
Console.WriteLine("oh no");
}
}
}
}