博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
九度1010 A + B
阅读量:4104 次
发布时间:2019-05-25

本文共 970 字,大约阅读时间需要 3 分钟。

/********************************* *    日期:2012-6-28 *    作者:SJF0115 *    题号: 九度1010 *    题目:A + B *    结果:AC *    题意: *    总结:**********************************/#include
#include
#include
using namespace std;int ToNumber(string A){ if(A=="one") return 1; else if(A=="two") return 2; else if(A=="three") return 3; else if(A=="four") return 4; else if(A=="five") return 5; else if(A=="six") return 6; else if(A=="seven") return 7; else if(A=="eight") return 8; else if(A=="nine") return 9; else if(A=="zero") return 0; else return -1;}int main(){ string num[1000]; int i = 0; //输入重定向,输入数据将从in.txt文件中读取 //freopen("C:\\Users\\SJF\\Desktop\\in.txt","r",stdin); while(cin>>num[i]) { int num1 = 0,num2 = 0; //遇到等号停止输入 if(num[i] != "="){ i++; continue; } int j = 0; while(num[j] != "+"){ num1 = num1 * 10 + ToNumber(num[j]); j++; } while(++j

转载地址:http://rmdsi.baihongyu.com/

你可能感兴趣的文章
Java编程基础:抽象类和接口
查看>>
Java编程基础:异常处理
查看>>
Spring MVC中使用Thymeleaf模板引擎
查看>>
Spring处理表单提交
查看>>
Spring MVC异常处理
查看>>
Leetcode 1180. Count Substrings with Only One Distinct Letter [Python]
查看>>
PHP 7 的五大新特性
查看>>
php实现socket(转)
查看>>
PHP底层的运行机制与原理
查看>>
深入了解php底层机制
查看>>
PHP中的stdClass 【转】
查看>>
XHProf-php轻量级的性能分析工具
查看>>
PHP7新特性 What will be in PHP 7/PHPNG
查看>>
比较strtr, str_replace和preg_replace三个函数的效率
查看>>
ubuntu 下编译PHP5.5.7问题:configure: error: freetype.h not found.
查看>>
PHP编译configure时常见错误 debian centos
查看>>
configure: error: Please reinstall the BZip2 distribution
查看>>
OpenCV gpu模块样例注释:video_reader.cpp
查看>>
【增强学习在无人驾驶中的应用】
查看>>
OpenCV meanshift目标跟踪总结
查看>>