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 ...
随机推荐
- SolrCloud索引富文本数据
solrconfig配置文件: schema配置文件: 执行目录: /opt/solr-5.5.4/server/scripts/cloud-scripts -- 下载配置文件 ./zkcli.sh ...
- ORA-01144_表空间数据文件超出最大限制
Oracle11gR2扩展表空间报ORA-01144错误. 数据块大小为8K的数据库,单个数据文件大小限制在32GB内. 解决办法: 1.增加表空间数据文件的方式: 2.创建BIGFILE表空间:
- 如何移除EditText自动焦点
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_cont ...
- break跳出嵌套循环体
package com.wh.Object; public class Test { public static void main(String[] args) { // TODO Auto-gen ...
- 设置当前导航栏(navigationController)的标题
一般在有导航navigationController的情况下,要设置页面的标题很简单 self.title = @"测试"; 也可以 self.navigationItem.tit ...
- js 验证码倒计时效果
function settime(obj) { if(second == 0){ obj.removeAttribute("disabled"); obj.value=" ...
- Python游戏开发入门
Pygame简介与安装 1.Pygame安装 pip install pygame2.检测pygame是否安装成功 python -m pygame.examples.aliens Pygame最小开 ...
- Java入门第39课——猜字母游戏之实现字母生成方法
问题 实现猜字母游戏中的字母生成方法,即,随机生成5个不同的字母作为猜测的结果. 方案 实现generate方法,首先声明一个字符类型的数组,用于存储26个大写字母,然后声 ...
- redis 其他特性
1.消息订阅与发布 subscribe my1 订阅频道 psubscribe my1* 批量订阅频道,订阅以my1开头的所有频道 publish my1 hello 在指定频道中发布消息,返回值为接 ...
- C#中练级orcle数据查询
直接贴代码哈哈哈, public DataTable getInfo(int flag) { OracleConnection conn = null; DataSet ds = new DataSe ...