#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. Optimizing Downloads for Efficient Network Access

    Optimizing Downloads for Efficient Network Access Previous  Next 1.This lesson teaches you to Unders ...

  2. Java中的流(5)大数据流的分段读取

    来自文件 或 网络的InputStream数据量可能很大,如果用流的大小申请byte[],可能内存不足报错. 解决方案:分段读取 InputStream的方法int available()返回本次可读 ...

  3. D. Green and Black Tea 贪心 + 构造

    http://codeforces.com/contest/746/problem/D 首先说下一定是NO的情况. 假设a > b 那么,b最多能把a分成b + 1分,如果每份刚好是k的话,那么 ...

  4. 增大PHP允许上传的文件大小;解决POST Content-Length exceeds the limit

    在php.ini中: upload_max_filesize = 1000M ;1GB post_max_size = 1000M 然后重启apache 参考链接

  5. 希尔排序法及其js实现

    希尔(Shell)排序又称为缩小增量排序,它是一种插入排序.它是直接插入排序算法的加强版. 希尔增量: 希尔增量是指希尔提出了一种冲破二次时间屏障的算法. Donald Shell 提出了一种冲破二次 ...

  6. JAVA一些错误代码

    //算术异常 ArithmeticExecption //空指针异常类 NullPointerException //类型强制转换异常 ClassCastException //数组负下标异常 Neg ...

  7. 使用Win7 64位旗舰版光盘映像安装Windows Home basic 64位操作系统

    工作当中需要安装Windows home basic 64位操作系统,苦于手头没有该版本的安装光盘,也没时间下载其安装映像.因此,在现有资源“cn_windows_7_ultimate_with_sp ...

  8. 迅为IMX6开发板支持4G全网通模块GPS模块

    IMX6开发板特点 处理器:IMX6开发板支持4G全网通模块GPS模块. 核心板配置:2GB DDR3内存  16GB EMMC 存储,扩展引脚多达320个:运行温度-20 ℃到+80 ℃之间. 核心 ...

  9. H5 canvas 直线和三角形

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. flutter 实现圆角头像的2种方法

    圆角头像在开发中应用太普遍了,我总结了2种实现方法,分享给大家 方法一: 使用Container组件的decoration可以实现 Container( width: 40, height: 40, ...