HDU-1228-A + B(简单字符串处理)
来源:互联网 发布:python 实现c4.5算法 编辑:程序博客网 时间:2024/04/29 06:20
//传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1228 #include <queue>#include <functional>#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <stack>#include <vector>#include <set>#include <map>#include <string>#include <cmath>#include <cstdlib>#include <ctime>#include <assert.h>using namespace std;#define N 15 string s;string tmp[N]={"zero","one","two","three","four","five","six","seven","eight","nine"};//利用字符串数组更方便操作int main(){ while(1){ int a=0; while(cin>>s,s!="+"){ //以 "+" 分隔两个数字 for(int i=0;i<10;i++){ if(s==tmp[i]){ a=a*10+i; break; } } } int b=0; while(cin>>s,s!="="){ //以 "=" 标志第二个数字输入结束 for(int i=0;i<10;i++){ if(s==tmp[i]){ b=b*10+i; break; } } } if(a+b==0) break; cout<<a+b<<endl; } return 0;}
0 0
- HDU-1228-A + B(简单字符串处理)
- hdu 3787 A+B(简单字符串处理)
- hdu 1228 A+B【字符串处理】
- HDU 1228 A + B【字符串的处理】
- HDU-1228-A+B(字符串处理)
- hdu 1228 A+B 字符串处理 超级大水题
- [ACM] hdu 1228 A+B (字符串处理)
- hdu 1228 A+B (字符串处理) 水
- A + B 字符串处理
- HDU 3819 A and B Problem 对字符串进行处理
- HDU 2054 A == B ? (字符串处理)
- HDU 2054 A == B ? 字符串处理
- HDU 1228 A + B 字符串水题
- HDU 1576 A/B 【带简单处理的扩展欧几里得】
- hdu 1228 A+B(简单模拟)
- 【水题+字符串】杭电 hdu 1228 A + B
- HDU 1228 A + B 字符串操作(常规 & hash)
- hdu 1228 A + B 详细题解 字符串/哈希
- 大数据如何驱动商业模式、用户体验和精细化运营?
- Spring多数据源管理源码分析
- Android 隐藏软键盘
- 比特币,黄金,纸币与区块链
- nodejs安装cordova和ionic
- HDU-1228-A + B(简单字符串处理)
- 生成两类服从高斯分布的数据
- android之requestWindowFeature详解
- 系统架构师、系统分析师、项目管理师的关系
- LED花样灯
- Android Studio某个Activity的标题隐藏
- 安卓电话拨号器小项目
- 设计基于HTML5的APP登录功能及安全调用接口的方式(原理篇)
- Java性能监控工具(jstack)