hdu 4788
#include<stdio.h>
#include<math.h>
int main() {
int a,i,n,m=0;
double d=1000;
char s[30],ch;
for(i=1;i<=10;i++)
d/=2;
int t;
scanf("%d",&t);
while(t--) {
scanf("%s",s);
n=0;
for(i=0;s[i];i++) {
if(s[i]>='0'&&s[i]<='9')
n=n*10+s[i]-'0';
else {
if(s[i]=='[')
continue;
ch=s[i];
break;
}
}
printf("Case #%d: ",++m);
if(ch=='B')
printf("%.2f%%\n",(1-pow(d,0))*100);
if(ch=='K')
printf("%.2f%%\n",(1-pow(d,1))*100);
if(ch=='M')
printf("%.2f%%\n",(1-pow(d,2))*100);
if(ch=='G')
printf("%.2f%%\n",(1-pow(d,3))*100);
if(ch=='T')
printf("%.2f%%\n",(1-pow(d,4))*100);
if(ch=='P')
printf("%.2f%%\n",(1-pow(d,5))*100);
if(ch=='E')
printf("%.2f%%\n",(1-pow(d,6))*100);
if(ch=='Z')
printf("%.2f%%\n",(1-pow(d,7))*100);
if(ch=='Y')
printf("%.2f%%\n",(1-pow(d,8))*100);
}
return 0;
}
hdu 4788的更多相关文章
- HDU - 4788 Hard Disk Drive (成都邀请赛H 水题)
HDU - 4788 Hard Disk Drive Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I ...
- 水题~~~~HDU 4788
Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gi ...
- HDU 4788 Hard Disk Drive (2013成都H,水题) 进位换算
#include <stdio.h> #include <algorithm> #include <string.h> #include<cmath> ...
- HDU 4788 Hard Disk Drive (2013成都H,水题)
Hard Disk Drive Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- hdu 4788 (2013成都现场赛 H题)
100MB=10^5KB=10^8B 100MB=100*2^10KB=100*2^20B Sample Input2100[MB]1[B] Sample OutputCase #1: 4.63%Ca ...
- hdu 4788 Hard Disk Drive (水题)
题意: Input The first line contains an integer T, which indicates the number of test cases. For each t ...
- The 2013 ACMICPC Asia Regional Chengdu
还有19天出发北京站,今年北京站的出题方是上交,去年他们出的成都现场的赛题,首先复盘一下. 去年的成都是我经历的第一次现场赛,也是近距离第一次见到了CLJ的真人,最后也是被虐惨了,那时候是声闻大神带着 ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
随机推荐
- js中判断数据类型的方法 typeof
<input type="text" onblur="demo(this)"/><br/> <input type="n ...
- Java-超市购物小票案例-详细介绍
1.1 超市购物购物小票需求分析 用户循环进行三个操作: 1.输入购买数量,代表为所购买货物的数量赋值,从而计算每项商品金额 2.打印小票,将已有数据打印 3.退出系统(因为该程序为循环操作,无法终 ...
- 抽象工厂模式和php实现
抽象工厂模式: 抽象工厂模式(Abstract Factory Pattern):提供一个创建一系列相关或相互依赖对象的接口,而无须指定它们具体的类.抽象工厂模式又称为Kit模式,属于对象创建型模式. ...
- BootStrap Select2组件
想使用Select2组件必须引用:select2.min.css和select2.min.js两个文件:如下: 页面写法很简单: 在这里多选是没有搜索功能的,只有单选的时候才会有搜索功能. Selec ...
- addslashes,stripslashes
官方介绍: (PHP 4, PHP 5) addslashes — 使用反斜线引用字符串 返回字符串,该字符串为了数据库查询语句等的需要在某些字符前加上了反斜线.这些字符是单引号(’).双引号(”). ...
- thinkphp5 404 file_put_contents 无法打开流:权限被拒绝
如果你用TP的时间比较长,或者说你比较了解TP的人都会知道,TP的runtime它需要的权限是很大的,如果你只给一般权限肯定是不行的,通常都是给runtime权限:777: linux命令如下: cd ...
- PHP网络协议相关考点
HTTP状态码 HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码. HTTP状态码主要有5种,代表5种不同类型的响应: 1xx:信息性状态码,代表接 ...
- iis 配置文件解决跨域问题
<system.webServer> <httpProtocol> <customHeaders> <add name="Access-Contro ...
- Java HTTP 组件库选型看这篇就够了
最近项目需要使用 Java 重度调用 HTTP API 接口,于是想着封装一个团队公用的 HTTP client lib. 这个库需要支持以下特性: 连接池管理,包括连接创建和超时.空闲连接数控制.每 ...
- inux 软件编译、安装、删除
640?wx_fmt=otherimage.png 本文学习内容 手动安装软件 手动安装下载源码的软件 源码编译3步骤 deb包-包依赖管理 dekg -l 查看所以安装deb的包 apt-get仓库 ...