//
// main.cpp
// 160929
//
// Created by 刘哲 on 17/4/13.
// Copyright © 2016年 my_code. All rights reserved.
//
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <bitset>
#include <stack>
#include <stdlib.h>
#define lowbit(x) (x&-x)
using namespace std;
double n;
char s[10];
map<string,int>mp;
int main()
{
int T;
cin>>T;
int cas = 1;
int k = 0;
mp["B]"] = k++;
mp["KB]"] = k++;
mp["MB]"] = k++;
mp["GB]"] = k++;
mp["TB]"] = k++;
mp["PB]"] = k++;
mp["EB]"] = k++;
mp["ZB]"] = k++;
mp["YB]"] = k++;
while(T--){
scanf("%lf[%s",&n,s);
string str;
for(int i=0;i<strlen(s);i++)
str+=s[i];
//double t = solve(s);
int t = mp[str];
double ans=pow(1000.0,t)/pow(1024.0,t);
ans=1-ans;
printf("Case #%d: %.2lf%%\n",cas++,ans*100);
}
return 0;
}
hdu 4799 进制转化(水)
最新推荐文章于 2019-09-25 22:20:04 发布