1006 换个格式输出整数

水题。

#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;
}

 

posted @ 2020-02-15 14:16  tangq123  阅读(69)  评论(0编辑  收藏  举报