HDU 1720 A+B Coming
#include <string>
#include <cstdio>
#include <iostream>
using namespace std;
int change(char ch)
{
if(ch<='' && ch>='')
return ch-'';
else
{
ch=toupper(ch);
return ch-'A'+;
}
}
int main()
{
char a[],b[];
int sa,sb,ans;
while (cin>>a>>b)
{
sa=; sb=;
for (int i=; i<strlen(a); i++)
{
sa*=;
sa+=change(a[i]);
}
for (int i=; i<strlen(b); i++)
{
sb*=;
sb+=change(b[i]);
}
printf("%d\n",sa+sb);
}
return ;
}
翻译: hexadecimal number 十六进制数
注意点:字符数组是从0开始的,积累字符转化函数toupper,需要用库string。
HDU 1720 A+B Coming的更多相关文章
- HDOJ(HDU) 1720 A+B Coming(进制)
Problem Description Many classmates said to me that A+B is must needs. If you can't AC this problem, ...
- HDU题解索引
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsu ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- hdu 1598 find the most comfortable road(枚举+卡鲁斯卡尔最小生成树)
find the most comfortable road Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
随机推荐
- matlab GUI之常用对话框(二)-- 进度条的使用方法
常用对话框(二) 进度条 waitbar 调用格式: h = waitbar(x,'message') waitbar(x,'message','CreateCancelBtn','button ...
- C#中的ref与out参数(本文仅作为个人笔记)
假如一个方法的参数(形参)是引用类型,那么使用那个参数来进行的任何修改都会改变参数引用的数据.但这里的关键在于,虽然引用的数据发生了变化,但参数本生没有改变——它仍然引用的是一个对象.换句话说,虽然可 ...
- poj2311
博弈论——sg,mex sg性质:1.在末态的状态点为N态. 2.P态的下一步有一个是N态 3.N态的下一步全部是P态. 当然这是对于单点一个游戏的情形,也相当于NIM只有一堆石子. mex(mini ...
- ThinkPHP第二十一天(JQuery元素获取,parents属性,toggle方法,确认弹出对话框使用)
1.JQuery用法 A:$(function(){code...});表示当页面载入完毕后执行 B:获取元素方法:根据class名称 $('.classname'),根据ID名称 $('#IDnam ...
- codeforces 633C. Spy Syndrome 2 hash
题目链接 C. Spy Syndrome 2 time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- linux系统性能监控常用命令
一.Linux服务器性能关注点 1)CPU -> load:表示cpu在一段时间内正在处理以及等待处理的任务之和统计信息,简单可理解为cpu正处理的线程数和能同时处理的线程数的比值.一般认为 ...
- jquery 工作笔记,不断整理中..
$('input:radio[name="ruleType"]:checked').val() //获得radio选中的值 $("input[name='Q_lastU ...
- Windows Server 2012 R2 Standard序列号
备用一个吧,免得用起来的时候找不到. NB4WH-BBBYV-3MPPC-9RCMV-46XCB
- win7使用的一些误区以及困惑
总结了一些新人在使用win7时容易产生的误区和困惑,罗列出来说明一下,以便新人能尽快适应新的操作系统. 1.内存使用的问题:这是个大误区,很多人都用xp时代的眼光来审视win7,这是错误的,因为两者的 ...
- oracle 配置监听
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521 ...