编程介的小学生 2017-10-26 01:31 采纳率: 20.5%
浏览 870
已采纳

HardDisk Drive

Problem Description
  Yesterday your dearcousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gift becauseyou will get married next year.
  But you turned on yourcomputer and the operating system (OS) told you the HDD is about 95MB. The 5MBof space is missing. It is known that the HDD manufacturers have a differentcapacity measurement. The manufacturers think 1 “kilo” is 1000 but the OSthinks that is 1024. There are several descriptions of the size of an HDD. Theyare byte, kilobyte, megabyte, gigabyte, terabyte, petabyte, exabyte, zetabyteand yottabyte. Each one equals a “kilo” of the previous one. For example 1gigabyte is 1 “kilo” megabytes.
  Now you know the size ofa hard disk represented by manufacturers and you want to calculate thepercentage of the “missing part”.
Input
  The first line containsan 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 apositive integer within [1, 1000] and unit is the description of size whichcould be “B”, “KB”, “MB”, “GB”, “TB”, “PB”, “EB”, “ZB”, “YB” in shortrespectively.
Output
  For each test case,output one line “Case #x: y”, where x is the case number (starting from 1) andy is the percentage of the “missing part”. The answer should be rounded to twodigits after the decimal point.
Sample Input
2
100[MB]
1[B]
Sample Output
Case #1: 4.63%
Case #2: 0.00%

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-11-09 07:42
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?