#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<iostream>
#include<cmath>
using namespace std;
typedef long long LL;
string s1,s2,f;
int d;
int main()
{
int ans=0;
while(cin>>s1)
{
if(s1[0]=='0')
{
printf("%d\n",ans);
ans=0;
}
else if(s1[0]=='#')
break;
else
{
cin>>s2>>d>>f;
if(f[0]=='F')
{
ans+=d*2;
}
else if(f[0]=='B')
{
double bonus=(int)((double)(d*1.0)/2+0.5);
ans=ans+d+bonus;
}
else if(f[0]=='Y')
{
if(d<=500)
ans+=500;
else
{
ans+=d;
}
}
}
}
return 0;
}
/**************************************************************
Problem: 1484
User: cust123
Language: C++
Result: Accepted
Time:10 ms
Memory:1520 kb
****************************************************************/
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交