您的位置:首页 > 编程语言 > C语言/C++

C++ hdu 2055 An easy problem

2016-10-01 22:39 204 查看
#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息