2018/12/12 acm日常 第二周 第六题

HDU-2055
问题链接
题目本体

// A code block
#include<iostream>
using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	for (int i = 0,x=0; i < n; i++)
	{
		
		char word; int num;
		cin >> word >> num;
		if ((int)word < 91)
		{
			x = (int)word - 64;
			x += num;
			cout << x << endl;
		}
		else
		{
			x = 96 - (int)word;
			x += num;
			cout << x << endl;
		}

	}

    return 0;
}

在这里插入图片描述

以上为临时版本。

猜你喜欢

转载自blog.csdn.net/weixin_43975504/article/details/84979690