Hard Disk Drive

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 83    Accepted Submission(s): 48

Problem Description
  Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gift because you will get married next year.
  But you turned on your computer and the operating system (OS) told you the HDD is about 95MB. The 5MB of space is missing. It is known that the HDD manufacturers have a different capacity measurement. The manufacturers think 1 “kilo” is 1000 but the OS thinks that is 1024. There are several descriptions of the size of an HDD. They are byte, kilobyte, megabyte, gigabyte, terabyte, petabyte, exabyte, zetabyte and yottabyte. Each one equals a “kilo” of the previous one. For example 1 gigabyte is 1 “kilo” megabytes.
  Now you know the size of a hard disk represented by manufacturers and you want to calculate the percentage of the “missing part”.
 
Input
  The first line contains an integer T, which indicates the number of test cases.
  For each test case, there is one line contains a string in format “number[unit]” where number is a positive integer within [1, 1000] and unit is the description of size which could be “B”, “KB”, “MB”, “GB”, “TB”, “PB”, “EB”, “ZB”, “YB” in short respectively.
 
Output
  For each test case, output one line “Case #x: y”, where x is the case number (starting from 1) and y is the percentage of the “missing part”. The answer should be rounded to two digits after the decimal point.
 
Sample Input
2
100[MB]
1[B]
 
Sample Output
Case #1: 4.63%
Case #2: 0.00%

Hint

 
Source
 

水题一枚。。。。胡搞就行

 /* ***********************************************
Author :kuangbin
Created Time :2013-11-16 12:58:01
File Name :E:\2013ACM\专题强化训练\区域赛\2013成都\1008.cpp
************************************************ */ #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std; int change(char s[])
{
if(strcmp(s,"B]") == )return ;
if(strcmp(s,"KB]") == )return ;
if(strcmp(s,"MB]") == )return ;
if(strcmp(s,"GB]") == )return ;
if(strcmp(s,"TB]") == )return ;
if(strcmp(s,"PB]") == )return ;
if(strcmp(s,"EB]") == )return ;
if(strcmp(s,"ZB]") == )return ;
if(strcmp(s,"YB]") == )return ;
} char s[];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int T;
int iCase = ;
double a;
scanf("%d",&T);
while(T--)
{
iCase++;
scanf("%lf[%s",&a,s);
int t = change(s);
double ans = pow(1000.0,t)/pow(1024.0,t);
ans = -ans;
printf("Case #%d: %.2lf%%\n",iCase,ans*); }
return ;
}

HDU 4788 Hard Disk Drive (2013成都H,水题)的更多相关文章

  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 Hard Disk Drive (2013成都H,水题) 进位换算

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

  3. hdu 4788 Hard Disk Drive (水题)

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

  4. HDU 4790 Just Random (2013成都J题)

    Just Random Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. HDU 4786 Fibonacci Tree (2013成都1006题)

    Fibonacci Tree Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  6. HDU 4734 F(x) (2013成都网络赛,数位DP)

    F(x) Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  7. HDU 4731 Minimum palindrome (2013成都网络赛,找规律构造)

    Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  8. HDU 5889 Barricade(最短路+最小割水题)

    Barricade Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total ...

  9. hdu 1012:u Calculate e(数学题,水题)

    u Calculate e Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

随机推荐

  1. AC自动机(病毒侵袭 )

    题目链接:https://cn.vjudge.net/contest/280743#problem/B 题目大意:中文题目 具体思路:AC自动机模板题,编号的时候注意,是按照给定的id进行编号的.然后 ...

  2. 详细到没朋友,一文帮你理清Linux 用户与用户组关系~

    引用自:https://mp.weixin.qq.com/s/Fl8ZjaUQuLDx7jbgM-1T5w 1.用户和用户组文件 在 linux 中,用户帐号,用户密码,用户组信息和用户组密码均是存放 ...

  3. 善用backtrace解决大问题【转】

    转自:https://www.2cto.com/kf/201107/97270.html 一.用途: 主要用于程序异常退出时寻找错误原因 二.功能: 回溯堆栈,简单的说就是可以列出当前函数调用关系 三 ...

  4. 一个查看Access数据库密码的工具

    一个可以查看Access数据库密码的工具AccessCracker.需要.net2.0环境支持. 网盘地址:https://pan.baidu.com/s/1btbsFcsKO0Enj-rjkTlz6 ...

  5. 解决华为手机无法输出Debug级别log的问题

    近期购入了新款的华为手机荣耀8,手感.性能.颜值都非常好.作为android开发工程师,自然会用到真机进行日常的调试.然而,这部手机并没有这么“听话“!反复尝试开启开发者选项中的设置项,依旧无法输出L ...

  6. kafka查看消费数据

    一.如何查看 在老版本中,使用kafka-run-class.sh 脚本进行查看.但是对于最新版本,kafka-run-class.sh 已经不能使用,必须使用另外一个脚本才行,它就是kafka-co ...

  7. 使用abstract关键字的使用

    package abstract1.demo01; //使用abstract关键字修饰的类叫做抽象类public abstract class Father { public static void ...

  8. 使用php mcrypt加密解密

    数字签名:对数据和私钥进行hash运算得到消息摘要,连同消息本身一块发给客户端.数据签名强调客户端接收到的数据是来自特定服务端,服务端具有对数据不可否认性.客户端通过确认此次签名的正确性来判断拿到的消 ...

  9. ajax跨域请求Flask后台

    ajax中使用jsonp方式实现跨域 headers: {'Cookie' : document.cookie } #携带cookie xhrFields: { withCredentials: tr ...

  10. Ubuntu美化及配置,常见问题解决方案

    安装符合审美观,并且具有可用性的Ubuntu桌面,需要耗费一些时间与精力不过,相信我,这值得去做,你会享受这中间的过程,以及最后的成果 首先,我推荐安装的软件列表如下,在安装前,需要先执行以下的步骤: ...