#include <stdio.h>
int
f(char x) {
if (x >= 'A' && x <= 'Z') return x - 'A' + 1;
if (x >= 'a' && x <= 'z') return -(x - 'a' + 1);
}
int
main(int argc, char **argv) {
char x;
int y;
int ncase;
//freopen("in.txt", "r", stdin);
scanf("%d", &ncase);
getchar();
while (ncase--) {
scanf("%c%d", &x, &y);
getchar();
printf("%d\n", f(x) + y);
}
return 0;
}
HDU 2055 An easy problem
最新推荐文章于 2023-03-15 17:40:18 发布