编程介的小学生 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;
    }
    }
    }

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?