#include<stdio.h> #include<string.h> int main() { char str; int a,b,n; while(scanf("%d",&n)!=EOF) { for(a=0;a<n;a++) { getchar();//不加getchar();只能输入三组数据,scanf不会接收空行; scanf("%c",&str); scanf("%d",&b); if(str>=‘a‘&&str<=‘z‘) printf("%d",b-(str-‘a‘+1)); else if(str>=‘A‘&&str<=‘Z‘) printf("%d",b+(str-‘A‘+1)); printf("\n"); } } return 0; }
时间: 2024-10-21 20:31:02