HDU4788_Hard Disk Drive

时间:2023-03-10 02:43:11
HDU4788_Hard Disk Drive

水题。 但是我写挫了一个地方,Wa了三发。好吧,不能忍了。

还有,本屌不知道如何用printf输出%,哪位学过C++的大仙知道这是什么情况?  告诉我一声啊。

#include <iostream>
#include <cstdio>
#define eps 1e-12
using namespace std; double ans;
int t,k,n,cas=;
char s[]; int main()
{
scanf("%d",&t);
while (t--)
{
scanf("%d%s",&n,s);
if (s[]=='B') k=;
else if (s[]=='K') k=;
else if (s[]=='M') k=;
else if (s[]=='G') k=;
else if (s[]=='T') k=;
else if (s[]=='P') k=;
else if (s[]=='E') k=;
else if (s[]=='Z') k=;
else if (s[]=='Y') k=;
ans=;
while (--k) ans/=1.024;
printf("Case #%d: %.2f",++cas,-ans+eps);cout<<"%"<<endl;
}
return ;
}