编程介的小学生 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 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题