编程介的小学生 2017-11-16 16:11 采纳率: 20.5%
浏览 704

Hastiness

Problem Description
How many problems did you AC?
When you read this problem, don’t hasty and careless, this is also simple, haha, I didn’t cheat you.
The game over soon, WisKey starts using English begin countdown. He not only have no gene in math, but also bad in English. Fortunately, He met you who have gift in programming. So please help him to translate.

Input
Give you an integer T, output T in English, and note that all of words are lower case. (0<=T<=9999)

Output
One answer One line.
Details see sample.

Sample Input
2034
1234
123
24
0

Sample Output
two thousand and thirty-four
one thousand and two hundred and thirty-four
one hundred and twenty-three
twenty-four
zero

  • 写回答

2条回答 默认 最新

  • GYD_01 2017-11-18 08:44
    关注

    #include///Hastiness
    using namespace std;
    map M;
    map M1;
    map M2;
    void init()
    {
    M[1] = "one";
    M[2] = "two";
    M[3] = "three";
    M[4] = "four";
    M[5] = "five";
    M[6] = "six";
    M[7] = "seven";
    M[8] = "eight";
    M[9] = "nine";
    M[0] = "zero";

    M1[1] = "ten";
    M1[2] = "twenty";
    M1[3] = "thirty";
    M1[4] = "forty";
    M1[5] = "fifty";
    M1[6] = "sixty";
    M1[7] = "seventy";
    M1[8] = "eighty";
    M1[9] = "ninety";
    
    M2[0] = "ten";
    M2[1] = "eleven";
    M2[2] = "twelve";
    M2[3] = "thirteen";
    M2[4] = "fourteen";
    M2[5] = "fifteen";
    M2[6] = "sixteen";
    M2[7] = "seventeen";
    M2[8] = "eighteen";
    M2[9] = "nineteen";
    

    }
    int main()
    {
    int t,n,a,b,c,c1,c2,d;
    init();
    while(~scanf("%d",&n))
    {
    a=n/1000;
    b=n%1000/100;
    c1=n%100;
    c=c1/10;
    d=n%10;
    if(a!=0)
    {
    if(b==0&&c==0&&d==0)
    {
    cout< continue;
    }
    else
    {
    cout }
    }
    if(b!=0)
    {
    if(c==0&&d==0)
    {
    cout printf(" hundred\n");
    continue;
    }
    else
    {
    cout printf(" hundred and ");
    }
    }
    if(c1>=20)
    {
    if(d==0)
    {
    cout< continue;
    }
    else
    {
    cout continue;
    }
    }
    if(c1=10)
    {
    cout<<M2[d]<<endl;
    continue;
    }
    if(c1<10)
    {
    cout<<M[d]<<endl;
    }
    }
    }

    评论

报告相同问题?

悬赏问题

  • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?