1810: water problem II

http://acm.zzuli.edu.cn/zzuliacm/problem.php?id=1810

1810: water problem II

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 168   Solved: 78

Submit Status Web Board

Description

相信大家对A+B问题最熟悉了。

实验室有个女人(传说中的潘同学)经常卡在这种题目上。。。

有一次,他边敷着面膜边做题,遇见了这样一个题目:

输入两个表示数的英文单词,输出他们的和。(当然输入的是英文,输出的是10进制数)

他头脑太ben了,想了半天没想出来怎么做?你能帮助他么?

Input

多组输入数据。每组数据输入两个表示数的英文单词(输入的数据是0-9)

Output

对于每组数据输出一个和。

Sample Input

one two

Sample Output

3
map就好

/**类似康拓展开**/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <map>
using namespace std;
const int SIZE=1e4+10;
int a[SIZE];
map<string,int> ma;
void init(){
    ma["one"]=1;
    ma["two"]=2;
    ma["three"]=3;
    ma["four"]=4;
    ma["five"]=5;
    ma["six"]=6;
    ma["seven"]=7;
    ma["eight"]=8;
    ma["nine"]=9;
    ma["zero"]=0;
}
int main(){
    init();
    string s1,s2;
    while(cin>>s1>>s2){
        printf("%d\n",ma[s1]+ma[s2]);
    }
    return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值