HDU 2055 An easy problem
2013-05-15 22:29
369 查看
解题报告:
题目大意:给出一个整数y,和一个字母x,若字母x为大写,则f(x) = x-'A',若字母x为小写,则f(x)= 'a'-x,问题是输出f(x)+y的值。
水题,作一次判断就可以了。
View Code
题目大意:给出一个整数y,和一个字母x,若字母x为大写,则f(x) = x-'A',若字母x为小写,则f(x)= 'a'-x,问题是输出f(x)+y的值。
水题,作一次判断就可以了。
#include<cstdio> int main() { int T,y; char x[5]; scanf("%d",&T); while(T--) { scanf("%s%d",x,&y); if(x[0]>='A'&&x[0]<='Z') printf("%d\n",x[0]-'A'+y+1); else printf("%d\n",y-(x[0]-'a')-1); } return 0; }
View Code
相关文章推荐
- HDU 2055 An easy problem(关于这道题中的一些小问题希望大家了解)
- hdu 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- hdu 2055 An easy problem (水题)
- HDU 2055 An easy problem
- hdu 2055 An easy problem (java)
- HDU 2055 An easy problem
- hdu 2055 An easy problem (java)
- hdu 2055 An easy problem (水题)
- 【暑期基础3】C HDU 2055 An easy problem
- hdu 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- HDU 2055 An easy problem
- HDU_2055 An easy problem
- HDU_ACM-2055 An easy problem