计算机学院大学生程序设计竞赛(2015’12) 1009 The Magic Tower
#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的更多相关文章
- hdu 计算机学院大学生程序设计竞赛(2015’11)
搬砖 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submissi ...
- 计算机学院大学生程序设计竞赛(2015’11)1005 ACM组队安排
1005 ACM组队安排 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Pro ...
- 计算机学院大学生程序设计竞赛(2015’12)Study Words
Study Words Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- 计算机学院大学生程序设计竞赛(2015’12)Polygon
Polygon Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Su ...
- 计算机学院大学生程序设计竞赛(2015’12)The Country List
The Country List Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- 计算机学院大学生程序设计竞赛(2015’12) 1008 Study Words
#include<cstdio> #include<cstring> #include<map> #include<string> #include&l ...
- 计算机学院大学生程序设计竞赛(2015’12) 1006 01 Matrix
#include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> ...
- 计算机学院大学生程序设计竞赛(2015’12) 1003 The collector’s puzzle
#include<cstdio> #include<algorithm> using namespace std; using namespace std; +; int a[ ...
- 计算机学院大学生程序设计竞赛(2015’12) 1004 Happy Value
#include<cstdio> #include<cstring> #include<cmath> #include<vector> #include ...
随机推荐
- window.open弹出窗口调用controller
前台图片调用js函数 <img src='${pageContext.request.contextPath}/FlatUI/img/link.png' id='report' alt='&qu ...
- HttpRequest中常见的四种ContentType【转载】
本文转自:http://www.aikaiyuan.com/6324.html HTTP/1.1 协议规定的 HTTP 请求方法有 OPTIONS.GET.HEAD.POST.PUT.DELETE.T ...
- vb6 控件未注册问题解决
打开项目时弹出如题错误. 另附一个帖子:http://bbs.csdn.net/topics/390580540,这个帖子讨论的不错,可以提供很多思路. 解决办法:http://rewwensoftw ...
- sql求日期
2.求以下日期SQL: 昨天 select convert(varchar(10),getdate() - 1,120) 明天 select convert(varchar(10),getdate() ...
- (转)Tomcat内存设置详解
Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出JVM在启 ...
- 1.4 测试各阶段(单元、集成、系统 、Alpha、Beta、验收)
单元测试:单元测试是对软件基本组成单元(软件设计的最小单位)进行正确性检验的测试工作,如函数.过程(function,procedure)或一个类的方法(method).单元测试是一个方法层面上的测试 ...
- php 数据库并发处理
在并行系统中并发问题永远不可忽视.尽管PHP语言原生没有提供多线程机制,那并不意味着所有的操作都是线程安全的.尤其是在操作诸如订单.支付等业务系统中,更需要注意操作数据库的并发问题. 接下来我通过一个 ...
- 安卓开发-使用XML菜单布局简单介绍
使用xml布局菜单 目前为止我们都是通过硬编码来增加菜单项的,android为此提供了一种更便利的方式,就是把menu也定义为应用程序的资源,通过android对资源的本地支持,使我们可以更方便地 ...
- HDU 3038 How Many Answers Are Wrong (并查集)---并查集看不出来系列-1
Problem Description TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad b ...
- 转:lr_eval_string函数的用法解析
在LR中,C的变量和LR的参数是不一样的. 任何C的变量都不能被LR的函数直接调用. 应该用lr_eval_string来取值. 比如{NewParam}(LR中参数化的变量)直接用这个引用是没有问题 ...