hdu 4788 (2013成都现场赛 H题)

时间:2021-10-12 07:13:12

100MB=10^5KB=10^8B

100MB=100*2^10KB=100*2^20B

Sample Input
2
100[MB]
1[B]

Sample Output
Case #1: 4.63%
Case #2: 0.00%

 # include <iostream>
# include <cstdio>
# include <cstring>
# include <algorithm>
# include <string>
# include <cmath>
# include <queue>
# include <list>
# define LL long long
using namespace std ; char s[]; 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 ;
} int main()
{
//freopen("in.txt","r",stdin) ;
int T ;
scanf("%d" , &T) ;
int Case = ;
while(T--)
{
Case++ ;
int x ;
scanf("%d[%s" , &x , s) ;
int t = change(s) ;
double ans = pow(1000.0,t)/pow(1024.0,t) ;
ans = - ans ;
printf("Case #%d: %.2lf%%\n",Case,ans*); } return ;
}