Problem Description

AekdyCoin is the most powerful boy in the group ACM_DIY, whose signature is valuable. In order to get his signature, you must first solve this problem. But don't be worried, because this is the easiest problem in the world. You are given only one sentence written in English. You are asked to output a single integer implied by this sentence.

Input

There is only one line in the input. It is a sentence which implies some integer. The length of the sentence is no more than 16. The sentence contains only letters(both uppercase and lowercase), digits, and whitespace. You may assume the given sentence is written in standard English, and always implies exactly one single integer.

Output

There is only one integer to output: that is the integer implied by the input sentence. You may assume this integer is in the range of 32-bit signed int.

Sample Input

One

Sample Output

1

AekdyCoin是ACM_DIY组合中实力最强的男孩,他的签名很有价值。为了得到他的签名,你必须先解决这个问题。但是不要担心,因为这是世界上最容易的问题。只给你一个用英语写的句子。要求您输出这个句子所隐含的单个整数。

输入

输入中只有一行。这是一个含有整数的句子。句子的长度不超过16。这个句子只包含字母(大写和小写)、数字和空格。您可以假设给定的句子是用标准英语编写的,并且总是暗示只有一个整数。

输出

输出只有一个整数:这是输入语句隐含的整数。您可以假设这个整数的范围是32位有符号整型。

样例输入

一个

样例输出

1

#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
string str;
string number[10] = { "zero","one","two","three","four","five","six","seven","eight","nine" };
cin >> str;
transform(str.begin(), str.end(), str.begin(), ::tolower);
for (int i = 0; i < 10; i++) {
if (str.find(number[i]) != string::npos) {
cout << i;
break;
}
}
return 0;
}

数字提取——C语言的更多相关文章

  1. [原]Java面试题-将字符串中数字提取出来排序后输出

    [Title][原]Java面试题-将字符串中数字提取出来排序后输出 [Date]2013-09-15 [Abstract]很简单的面试题,要求现场在纸上写出来. [Keywords]面试.Java. ...

  2. 提取字符串中的数字(C语言)

    题目要求 问题描述:给定一个任意字符串,提取出其中所包含的整数. 样例输入:A12 32bc de51f6576g 样例输出:共计 4 个整数:12 32 51 6576 解决方案-指针版本 核心思想 ...

  3. 【总结】java regex 正则表达式 提取数字和去除数字,过滤数字,提取价格

    @Test public void test33() { String phoneString = "哈哈,13888889999"; // 提取数字 Pattern patter ...

  4. 数字转汉字|语言代码|NSNumberFormatter

    iOS之阿拉伯数字转中文数字 - 简书 iOS中金额数字的格式化 NSNumberFormatter - 简书 ISO语言代码(ISO-639)与国家代码(ISO-3166) - CSDN博客 语种名 ...

  5. PAT 1012 数字分类 C语言

    给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字: A1 = 能被5整除的数字中所有偶数的和: A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3-n4...: ...

  6. [LeetCode] 2. Add Two Numbers 两个数字相加 java语言实现 C++语言实现

    [LeetCode] Add Two Numbers 两个数字相加   You are given two non-empty linked lists representing two non-ne ...

  7. 使用translate将字符串中的数字提取出来

    --方法1: with tmp as ( select '按时的撒旦123元(其中含存款11元)' name from dual union all select '一类似的预存9600元(新势力)' ...

  8. 数字信号处理C语言集(1.1 随机数的产生)

     main.cpp 所建工程文件如下图所示 uniform.h #ifndef _UNIFORM_H_ #define _UNIFORM_H_ double uniform(double a,doub ...

  9. php提取字符串中的数字

    最近工作中写代码的时候需要在一串字符串中将所有的数字提取出来这么一个小功能,研究了一下发现方法还挺多,值得记录一下,于是对如何使用PHP将字符串中的数字提取出来的功能做了一个小总结,总结三种方法如下: ...

随机推荐

  1. java fail-fast和fail-safe

    快速失败(fail—fast) 在用迭代器遍历一个集合对象时,如果遍历过程中对集合对象的内容进行了修改(如增加.删除等),则会抛出Concurrent Modification Exception. ...

  2. QQ群成员发言次数统计(正则表达式版)

    1.先将QQ群的消息记录以.txt文件格式导出来,保存路径及名称自己定义(在本文我导出到Y盘,命名为test.txt) 2.程序如下: data statistics1; if _n_=1 then ...

  3. npm cnpm

    npm 1.说明: npm(node package manager)是nodejs的包管理器,用于node插件管理(包括安装.卸载.管理依赖等) 2.使用npm安装插件:命令提示符执行npm ins ...

  4. eclipse 安装配置

    https://blog.csdn.net/jklinux/article/details/77861450 JAVA环境配置 https://jingyan.baidu.com/article/db ...

  5. CentOS 7安装php

    我们已经在上一篇里安装上了nginx:现在我们想要php(也许还包括mysql). (CentOS 7里使用mariadb替代了mysql) # yum install mariadb-client ...

  6. Android入门(一) IDEA上创建Android应用之helloworld

    Android入门(一) IDEA上创建Android应用之helloworld 首先看运行结果: 一.准备工作 下载安装IntelliJ IDEA :我这里用的是2018.2.7 下载安装Genym ...

  7. 在 iOS 上通过 802.11k、802.11r 和 802.11v 实现 Wi-Fi 网络漫游

    原文: https://support.apple.com/zh-cn/HT202628 了解 iOS 如何使用 Wi-Fi 网络标准提升客户端漫游性能.   iOS 支持在企业级 Wi-Fi 网络上 ...

  8. Jvm的体系结构

    1.垃圾回收器 垃圾回收器(又称为gc):是负责回收内存中无用的对象(好像地球人都知道),就是这些对象没有任何引用了,它就会被视为:垃圾,也就被干掉了. 2.类装载子系统 一听名字,大家就知道,肯定是 ...

  9. Java 中 Gson的使用

    JSON 是一种文本形式的数据交换格式,它比XML更轻量.比二进制容易阅读和编写,调式也更加方便;解析和生成的方式很多,Java中最常用的类库有:JSON-Java.Gson.Jackson.Fast ...

  10. linux上用route添加/删除路由

    1. 查看 route -n 2. 添加 route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1 3. 删除 route del -net ...