#include <iostream>
#include <cmath>
using namespace std;
int main() {
double x;
char ch;
while(cin >> x >> ch)
{
int ret = 0;
if(ch == 'y') ret += 5;
if(x <= 1) cout << ret + 20 << endl;
else cout << ret + 20 + ceil(x - 1.0);
}
return 0;
}
// 64 位输出请用 printf("%lld")
扩展两个库函数 : ceil 和 floor (天花板和地板) 在库 <cmath> 里面

京公网安备 11010502036488号