编程介的小学生 2019-06-13 20:02 采纳率: 20.5%
浏览 178

字符串和字符串之间的PK算法,这个问题用C语言的程序的设计的代码的编写的过程的实现的方式是什么

roblem Description
Name PK is a funny game on the Internet. The game will calculate character's property based on its name.
Now we're simulating a simple Name PK game. Each character has 3 parameters: HP, STR and SPD (HP for health point, STR for strength and SPD for attacking speed).

For a name string of length N, Ci is ASCII code (decimal) of the i-th char.

PK rule:
1. Timer begins to increase from 1. When it is a multiple of (20-SPD), the corresponding character A has that SPD attack once, the opposite lose STR(A's) HP.

  1. When any side has a HP ≤ 0, the PK is over.

Input
The input consists of several test cases. The first line of input consists of an integer T, indicating the number of test cases. Each test case is on a separate line, and it consists two strings separated by a whitespace, indicating the name of the characters.
Technical Specification

  1. Names contain only English letters.
  2. The length of each character's name is more than 1 and no more than 20.
  3. T ≤ 1000.

Output
For each test case, output a line consisting of the result of the first character: "win", "lose" or "tie".

Sample Input
3
Sylvia xay
Ivan Stacy
Boyd Greg

Sample Output
lose
win
lose

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!