计算机学院大学生程序设计竞赛(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 ...
随机推荐
- ajax实例及实现文本框异步搜素
search.jsp(WebContent/jsp/search.jsp) <%@ page language="java" contentType="text/h ...
- sqlQuery.list()方法返回类型
SQLQuery sqlQuery = session.createSQLQuery(this.sql.toString()); List<Object[]> list = (List&l ...
- 改良UIScrollView滚动视图
#define HEIGHT self.view.frame.size.height #define WIDTH self.view.frame.size.width @interface V ...
- github 安装配置以及使用遇到的一些问题
Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理.在推出后,Git在其它项目中也取得了很大成功,尤其是在Ruby社区中.目前,包括Rubinius ...
- 【最长下降子序列的长度和个数】 poj 1952
转自http://blog.csdn.net/zhang360896270/article/details/6701589 这题要求最长下降子序列的长度和个数,我们可以增加数组maxlen[size] ...
- “strcmp()” Anyone?
“strcmp()” Anyone? strcmp() is a library function in C/C++ which compares two strings. It takes two ...
- easyui easyui-filebox 显示中文
<input class="easyui-filebox" name="uploadFile" id="uploadFileid" d ...
- Android之SurfaceView学习(一)转转
Android之SurfaceView学习(一) 首先我们先来看下官方API对SurfaceView的介绍 SurfaceView的API介绍 Provides a dedicated drawing ...
- Viewpager实现网络图片的轮播
//主意:里面用到了第三方的Xutils.jar包和Imageloader.jar包还用到了访问网络,所以要加网络权限 <uses-permission android:name="a ...
- 自定义开关ToggleButton
package com.example.test;import android.os.Bundle;import android.app.Activity;import android.view.Me ...