1006 换个格式输出整数
这是个简单题就不分析了
#include<iostream>
using namespace std;
void caculate(int number)
{
int count_hundred = 0,count_ten=0,count_bit=0;
int count[3] = { 0 }; //计算后count[0]、[1]、[2]是个位十位百位
int i = 0,j=1;
while (number != 0)
{
count[i++] = number % 10;
number = number / 10;
}
while (count[2] != 0)
{
cout << "B";
count[2]--;
}
while (count[1] != 0)
{
cout << "S";
count[1]--;
}
while (count[0] != 0)
{
cout << j++;
count[0]--;
}
}
int main()
{
int n;
cin >> n;
caculate(n);
return 0;
}