#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std; int whp,wat,wdef,bhp,bat,bdef;
char s; int main()
{
while(~scanf("%c",&s))
{
scanf("%d%d%d",&whp,&wat,&wdef);
scanf("%d%d%d",&bhp,&bat,&bdef);
int t1=wat-bdef;
int t2=bat-wdef; if(s=='W')
{
while()
{
if(t1>) bhp-=t1;
if(bhp<=)
{
printf("Warrior wins\n");
break;
} if(t2>) whp-=t2;
if(whp<=)
{
printf("Warrior loses\n");
break;
} if(t1<=)
{
printf("Warrior loses\n");
break;
}
}
}
else if(s=='B')
{
while()
{
if(t2>) whp-=t2;
if(whp<=)
{
printf("Warrior loses\n");
break;
} if(t1>) bhp-=t1;
if(bhp<=)
{
printf("Warrior wins\n");
break;
} if(t1<=)
{
printf("Warrior loses\n");
break;
}
}
}
}
return ;
}

计算机学院大学生程序设计竞赛(2015’12) 1009 The Magic Tower的更多相关文章

  1. hdu 计算机学院大学生程序设计竞赛(2015’11)

    搬砖 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submissi ...

  2. 计算机学院大学生程序设计竞赛(2015’11)1005 ACM组队安排

    1005 ACM组队安排 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Pro ...

  3. 计算机学院大学生程序设计竞赛(2015’12)Study Words

    Study Words Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tota ...

  4. 计算机学院大学生程序设计竞赛(2015’12)Polygon

    Polygon Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Su ...

  5. 计算机学院大学生程序设计竞赛(2015’12)The Country List

    The Country List Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  6. 计算机学院大学生程序设计竞赛(2015’12) 1008 Study Words

    #include<cstdio> #include<cstring> #include<map> #include<string> #include&l ...

  7. 计算机学院大学生程序设计竞赛(2015’12) 1006 01 Matrix

    #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> ...

  8. 计算机学院大学生程序设计竞赛(2015’12) 1003 The collector’s puzzle

    #include<cstdio> #include<algorithm> using namespace std; using namespace std; +; int a[ ...

  9. 计算机学院大学生程序设计竞赛(2015’12) 1004 Happy Value

    #include<cstdio> #include<cstring> #include<cmath> #include<vector> #include ...

随机推荐

  1. shell之路【第四篇】输入输出重定向

    输出重定向 命令输出重定向的语法为: command > file 或 command >> file 这样,输出到显示器的内容就可以被重定向到文件.果不希望文件内容被覆盖,可以使用 ...

  2. C#输出日历

    用C#输出日历,此功能可用于Ajax方式列出计划日程相关的内容,由于是C#控制输出,可以方便加上自己需要的业务处理逻辑. 1.控制台输出: using System; namespace 控制台日历 ...

  3. tcpdump抓取HTTP包【转载】

    tcpdump -XvvennSs 0 -i eth0 tcp[20:2]=0x4745 or tcp[20:2]=0x4854 0x4745 为"GET"前两个字母"G ...

  4. ubuntu setup adb tool

    sudo add-apt-repository ppa:nilarimogard/webupd8sudo apt-get updatesudo apt-get install android-tool ...

  5. TCP数据包结构

    源端口号( 16 位):它(连同源主机 IP 地址)标识源主机的一个应用进程.目的端口号( 16 位):它(连同目的主机 IP 地址)标识目的主机的一个应用进程.这两个值加上 IP 报头中的源主机 I ...

  6. C# 实现屏幕键盘 (ScreenKeyboard)

    原文地址:http://www.cnblogs.com/youzai/archive/2008/05/19/1202732.html 要实现一个屏幕键盘,需要监听所有键盘事件,无论窗体是否被激活.因此 ...

  7. 小蚂蚁搬家<贪心>

    题意: 由于预知未来可能会下雨,所以小蚂蚁决定搬家.它需要将它的所有物品都搬到新家,新家的体积为V,小蚂蚁有N件物品需要搬,每件物品的体积为Ai,但他发现:每件物品需要新家剩余体积大于等于Bi才能使它 ...

  8. js 基础笔记三

    词法结构: 1:区分大小写 2:特殊字符的区分,unicode转义 3:注释, //  ;  /* */ ; 4 : 标识字符和保留字 数据类型: 1原始类型 数字,字符串,布尔值.特殊的原始值(nu ...

  9. 开源内容管理系统Joomla正式发布3.5版本 基于PHP 7

    这也是首个完全支持 PHP 7 语言开发的 Joomla 版本 作为深受广大站长喜爱的 Joomla 开源内容管理系统(Content Management System, CMS)正式推出 3.5 ...

  10. reflow和repaint区别?

    作者:zccst 重绘和重排之前也知道,但也没有可以详细了解他们的机制,区别,以及对性能的影响. A repaint occurs when changes are made to an elemen ...