1006

作者: 峡迩 | 来源:发表于2017-07-16 00:20 被阅读0次

个十百千不同,所以可以加入层级判断!

#include<iostream>
#include<string>

using namespace std;

int main()
{
    unsigned n;
    string out;

    cin >> n;

    if (n > 0)
    {
        unsigned a = n % 10;
        for (int i = 1; i <= a; ++i)
        {
            out = out + to_string(i);
        }
        n = n / 10;
        if (n > 0)
        {
            unsigned b = n % 10;
            for (int i = 0; i < b; ++i)
            {
                out = string("S") + out;
            }
        }
        n = n / 10;
        if (n > 0)
        {
            unsigned c = n % 10;
            for (int i = 0; i < c; ++i)
            {
                out = string("B") + out;
            }
        }
    }
    cout << out;


    system("pause");
    return 0;
}

相关文章

  • 培训记录2

    坚持分享第1006天 20201125

  • A_1006

    1006 Sign In and Sign Out (25) At the beginning of every ...

  • LeetCode #1006 Clumsy Factorial

    1006 Clumsy Factorial 笨阶乘 Description:The factorial of a ...

  • 1006

    //1006 换个格式输出整数 (15)(15 分)//让我们用字母B来表示“百”、字母S表示“十”,用“12.....

  • 1006

    南京的大排档好吃 明天回去了 去大剧院看看 下次再来深度游

  • 1006

    个十百千不同,所以可以加入层级判断!

  • 1006

    又到了十月的季节, 夜晚的集市人不多, 小孩在门口嬉戏, 温柔的女孩在安静的吃着浸润的甜蜜的米线, 阳光照暖了三川...

  • 1006

    很难过 却不知道究竟源于什么 家庭和自己在慢慢抽离 周旋和客套越来越剥离 直和累不能解释所有 有些爱发自内心 有些...

  • 1006

    早上好!#幸福实修#~每天进步1%#幸福实修12班@吕敏一富阳 20171006(11/30) 【幸福三朵玫瑰】 ...

  • 1006

    1. 突然觉得自己到了不想找朋友玩的境界,不管多少人一起,好像我只有自己~还是一个人待着比较轻松 2.也许是慢慢变...

网友评论

      本文标题:1006

      本文链接:https://www.haomeiwen.com/subject/pxttkxtx.html