hdu2055 An easy problem
2014-08-05 17:02
302 查看
An easy problem
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13676 Accepted Submission(s): 9235
[align=left]Problem Description[/align]
we define f(A) = 1, f(a) = -1, f(B) = 2, f(b) = -2, ... f(Z) = 26, f(z) = -26;
Give you a letter x and a number y , you should output the result of y+f(x).
[align=left]Input[/align]
On the first line, contains a number T.then T lines follow, each line is a case.each case contains a letter and a number.
[align=left]Output[/align]
for each case, you should the result of y+f(x) on a line.
[align=left]Sample Input[/align]
6 R 1 P 2 G 3 r 1 p 2 g 3
[align=left]Sample Output[/align]
19 18 10 -17 -14 -4[code]#include<stdio.h> int main() { int y,n,i; char x; scanf("%d",&n); while(n--){ getchar(); scanf("%c%d",&x,&y); if(x>='A'&&x<='Z') printf("%d\n",x-64+y); else printf("%d\n",y-(x-96)); } return 0; }
[/code]
相关文章推荐
- HDU2055_An easy problem
- HDU2055 An easy problem【水题】
- hdu2055 An easy problem
- Hdu2055 An easy problem
- hdu2055 An easy problem(C语言)
- HDU2055_An easy problem
- HDU 4729 An Easy Problem for Elfness (主席树,树上第K大)
- An Easy Problem?!(poj2826线段相交,直线线段相交)
- 【主席树】 HDOJ 4729 An Easy Problem for Elfness
- POJ 2826 An Easy Problem?!
- POJ 2826 An Easy Problem!?(超级恶心!!!···)
- hdu An easy problem (背包)
- An Easy Problem?!(细节题,要把所有情况考虑到)
- POJ 2826 An Easy Problem?!(计算几何)
- HDOJ 题目2132 An easy problem(水题,易错)
- HDU 2055 An easy problem
- 【暑期基础3】C HDU 2055 An easy problem
- An easy problem
- hdu 5475 An easy problem(线段树单点更新)
- HDU 2132 An easy problem