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 ...
随机推荐
- [转]为革命保护视力 --- 给 Visual Studio 换颜色
本文转自:http://www.cnblogs.com/stg609/p/3723968.html “为革命,保护视力,预防近视,眼保健操开始......” 这个应该是最老版本的眼保健操了,你听过? ...
- Web常见几种攻击与预防方式
DoS和DDoS攻击 DoS(Denial of Service),即拒绝服务,造成远程服务器拒绝服务的行为被称为DoS攻击.其目的是使计算机或网络无法提供正常的服务.最常见的DoS攻击有计算机网络带 ...
- web+ admin template,spa管理应用后台,easyui后台正式发布
演示地址:http://admintemplate.webplus.org.cn/ v1.0 (2016/7/27) 扁平化风格 全屏支持 后台管理不使用iframe,全ajax开发 权限管理 商品管 ...
- SQL表与表连接关系
一.SQL连接方式 left join :左连接,返回左表中所有的记录以及右表中连接字段相等的记录. right join :右连接,返回右表中所有的记录以及左表中连接字段相等的记录. inner j ...
- 内置函数isinstance和issubclass
1. isinstance(obj,class) 判断对象obj是不是由class生成的对象. class Foo: pass obj=Foo() print(isinstance(obj,Foo)) ...
- JS filters-table简单过滤-Version 1
初级版本: 输入框可检索,空格检索忽略 radio点击后会过滤 最后的两个输入框可根据age范围检索过滤 三个单独的功能,不能协同工作 <!DOCTYPE html> <html&g ...
- 跨库导表数据(sql)
程序员用 列子: insert into "000".tbFreeReportselect ReportCode ,ReportName ,GroupNamefrom openda ...
- Bash Template
#/bin/bash #set -x set -e usage() { cat <<EOF Usage: `basename $` [OPTIONS] <non-option arg ...
- cal - 显示一个日历
总览 cal [-mjy ] [月份 [年份 ] ] 描述 Cal 显示一个简单的日历.. 如果没有指定参数, 则显示当前月份. 选项如下所列: -m 显示星期一作为一周的第一天.. (缺省为星期日. ...
- Vim中文编码问题
1.影响中文编码的设置项 encoding(enc):encoding是Vim的内部使用编码,encoding的设置会影响Vim内部的Buffer.消息文字等.在 Unix环境下,encoding的默 ...