AC on #9
本机运行是对的(i see dead people输出31),不知道为啥会错
#include <bits/stdc++.h>
using namespace std;
#define maxn 101
#define LL long long
int sum;
int cishu(char x)
{
if (x == ' ') return 1;
if (x == 's' || x == 'z') return 4;
int p = (int)x;
if (x > 's')
{
p += 2;
}
if (p%3) return p%3;
else return 3;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
getline(cin,s);
for (int i = 0;i < s.length();i++)
{
if (i != s.length()-1 || s[i] != ' ') sum += cishu(s[i]);
}
cout<<sum;
return 0;
}