#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. webstrom 快捷键(Idea可用)

    在File-->setting可查看和配置功能快捷键,以下列出常用的快捷键 1. ctrl + shift + n: 打开工程中的文件,目的是打开当前工程下任意目录的文件. 2. ctrl + ...

  2. docker log 文件 清理

    1 查看docker log 文件位置  docker inspect *** 2 定时清理 runcate -s 0 /var/lib/docker/containers/*/*-json.log

  3. docker 基础命令

    检查Docker安装是否正确docker info拉取镜像docker pull (image name)启动docker run -d -d 后台运行查看日志docker logs $sample_ ...

  4. .htaccess文件url重写小记

    .htaccess文件url重写 当上一条规则匹配 并转换后 符合下一条规则的 继续下一条的匹配转换 RewriteRule ^shangpin-([0-9a-zA-Z]+)/category-([0 ...

  5. 推翻自己和过往,重学自定义View

    http://blog.csdn.net/lfdfhl/article/details/51671038 深入探讨Android异步精髓Handler 站在源码的肩膀上全解Scroller工作机制 A ...

  6. 【jsp exception】如何处理jsp页面的错误

    根据jsp对错误的处理方式不同可以将其分为局部异常处理和全局异常处理.局部异常处理适用于个别jsp页面,当这些页面发生错误后,采取特殊的处理方式:全局异常处理适用于所有jsp页面,当所有页面发生某些指 ...

  7. Vs2010 WPF 项目打包

    [转]图解WPF程序打包全过程 首先打开已经完成的工程,如图: 下面开始制作安装程序包. 第一步:[文件]——[新建]——[项目]——安装项目. 名称——可以自己根据要求修改. 位置——是指你要制作的 ...

  8. iOS label换行 自适应

    //自动折行设置 addressDetailLab.lineBreakMode = NSLineBreakByWordWrapping; addressDetailLab.numberOfLines ...

  9. javaweb 国际化

    国际化又称为 i18n:internationalization 软件实现国际化,需具备哪些特征:对于程序中固定使用的文本元素,例如菜单栏.导航条等中使用的文本元素.或错误提示信息,状态信息等,需要根 ...

  10. Django - 用户注册

    使用Django工程自动创建的auth_user表来存储用户信息 在app目录下创建forms.py mysite/music/forms.py from django.contrib.auth.mo ...