#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的更多相关文章

  1. HDU - 4788 Hard Disk Drive (成都邀请赛H 水题)

    HDU - 4788 Hard Disk Drive Time Limit:1000MS   Memory Limit:32768KB   64bit IO Format:%I64d & %I ...

  2. 水题~~~~HDU 4788

    Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gi ...

  3. HDU 4788 Hard Disk Drive (2013成都H,水题) 进位换算

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

  4. 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 ...

  5. 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 ...

  6. hdu 4788 Hard Disk Drive (水题)

    题意: Input The first line contains an integer T, which indicates the number of test cases. For each t ...

  7. The 2013 ACMICPC Asia Regional Chengdu

    还有19天出发北京站,今年北京站的出题方是上交,去年他们出的成都现场的赛题,首先复盘一下. 去年的成都是我经历的第一次现场赛,也是近距离第一次见到了CLJ的真人,最后也是被虐惨了,那时候是声闻大神带着 ...

  8. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  9. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

随机推荐

  1. 实现php间隔一段时间执行一次某段代码

    <?php ignore_user_abort(); //即使Client断开(如关掉浏览器),PHP脚本也可以继续执行.  set_time_limit(0); // 执行时间为无限制,php ...

  2. Angular广播/消息通知的接收与发送

    一.在接收页:添加引用: private eventManager: JhiEventManager: 接收通知的方法: // 接收通知(新建.编辑.删除页发送过来的通知) // upmsMenuLi ...

  3. spring 整合struts

    1.例子:未被spring整合 struts.xml 的配置文件 <constant name="struts.enable.DynamicMethodInvocation" ...

  4. 分享div、text、Box Shadow(阴影)演示及代码的页面

    附图: 直接上链接:www.css88.com/tool/css3Preview/Box-Shadow.html

  5. 【C++】异常简述(一):C语言中的异常处理机制

    人的一生会遇到很多大起大落,尤其是程序员. 程序员写好的程序,论其消亡形式无非三种:无疾而终.自杀.他杀. 当然作为一名程序员,最乐意看到自己写的程序能够无疾而终,因此尽快的学习异常处理机制是非常重要 ...

  6. JPA createNativeQuery遇到的几个问题

    1.count方法返回值类型为java.math.BigInteger Query query = null; String sql = null; sql = "select count( ...

  7. 说说windows10自带浏览器Edge的好与不好

    用了10几个月了,正式版也升级了,今天来说说微软自带浏览器microsoft Edge的好与不好       先说好的吧     一,浏览器速度非常快,无论是打开还是关闭,或者是语音助手小娜需要调动浏 ...

  8. Locations for Public Frameworks

    Locations for Public Frameworks Third-party frameworks can go in a number of different file-system l ...

  9. dom监听事件class

    layui.use(['layer', 'form'], function(){ var layer = layui.layer ,form = layui.form; var $ = layui.j ...

  10. 表单文件上传编码方式(enctype 属性)

    enctype 属性规定在发送到服务器之前应该如何对表单数据进行编码. 如下: <form action="upload.php" method="post&quo ...