C++ hdu 2055 An easy problem

来源:互联网 发布:最好的seo课程 编辑:程序博客网 时间:2024/05/20 20:21
#include<iostream>using namespace std;int main(){    int n,y;    char x;    cin >> n;    while (n--)    {        cin >> x >> y;        if (x>='A'&&x<='Z')        {            cout << y + (x - 'A' + 1)<<endl;        }       if(x>='a'&&x<='z')        {            cout << y - (x - 'a' + 1)<<endl;        }    }    return 0;}
0 0
原创粉丝点击