#include <iostream>
#include<string.h>
using namespace std;
int f(char c){
int res;
if (c >= 'a'&&c <= 'z')
res = -(c - 'a' + 1);
else if (c >= 'A'&&c <= 'Z')
res = c - 'A' + 1;
return res;
}
int main()
{
int n;
char c;
int a;
while (cin >> n)
{
while (n--)
{
cin >> c >> a;
cout<<f(c) + a<<endl;
}
}
return 0;
}
最后
以上就是有魅力保温杯最近收集整理的关于杭电2055 easy的全部内容,更多相关杭电2055内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复