Codeforces Round #299 (Div. 2) A. Tavas and Nafas 水题

A. Tavas and Nafas

Time Limit: 1 Sec  Memory Limit: 256 MB

题目连接

http://codeforces.com/contest/535/problem/A

Description

Today Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.

His phone operating system is Tavdroid, and its keyboard doesn't have any digits! He wants to share his score with Nafas via text, so he has no choice but to send this number using words.

He ate coffee mix without water again, so right now he's really messed up and can't think.

Your task is to help him by telling him what to type.

Input

The first and only line of input contains an integer s (0 ≤ s ≤ 99), Tavas's score.
1000000000.

Output

In the first and only line of output, print a single string consisting only from English lowercase letters and hyphens (' -'). Do not use spaces.

Sample Input

6

Sample Output

six

HINT


题意

给你100以下数字,输出英文

题解:

沙比提

代码:

 

//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200001
#define mod 10007
#define eps 1e-9
//const int inf=0x7fffffff;   //无限大
const int inf=0x3f3f3f3f;
/*

int buf[10];
inline void write(int i) {
  int p = 0;if(i == 0) p++;
  else while(i) {buf[p++] = i % 10;i /= 10;}
  for(int j = p-1; j >=0; j--) putchar('0' + buf[j]);
  printf("\n");
}
*/
//**************************************************************************************
inline ll read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
map<int,string> s;



int main()
{
    int n=read();
    s[1]="one";
    s[2]="two";
    s[3]="three";
    s[4]="four";
    s[5]="five";
    s[6]="six";
    s[7]="seven";
    s[8]="eight";
    s[9]="nine";
    s[10]="ten";
    s[11]="eleven";
    s[12]="twelve";
    s[13]="thirteen";
    s[14]="fourteen";
    s[15]="fifteen";
    s[16]="sixteen";
    s[17]="seventeen";
    s[18]="eighteen";
    s[19]="nineteen";
    s[20]="twenty";
    s[30]="thirty";
    s[40]="forty";
    s[50]="fifty";
    s[60]="sixty";
    s[70]="seventy";
    s[80]="eighty";
    s[90]="ninety";
    if(n==0)
        cout<<"zero"<<endl;
    else if(n<=20)
        cout<<s[n]<<endl;
    else if(n%10==0)
        cout<<s[n]<<endl;
    else 
        cout<<s[n-n%10]<<"-"<<s[n%10]<<endl;
}

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值