码迷,mamicode.com
首页 > 其他好文 > 详细

1006 换个格式输出整数

时间:2020-02-15 15:38:34      阅读:52      评论:0      收藏:0      [点我收藏+]

标签:class   --   span   namespace   水题   str   using   std   整数   

水题。

#include"iostream"
using namespace std;

int main() {
    int n;
    cin>>n;
    int a = n/100;//百分位 
    int b = n%100/10;//十分位 
    int c = n%10;//个位 
    while(a--)
        cout<<"B";
    while(b--)
        cout<<"S";
    for(int i = 1; i <= c; ++i)
        cout<<i;
    return 0;
}

 

1006 换个格式输出整数

标签:class   --   span   namespace   水题   str   using   std   整数   

原文地址:https://www.cnblogs.com/keep23456/p/12312036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!