1006

 1 #include<iostream>
 2 #include<stack>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     stack<char> s;
 9     int n;
10     cin >> n;
11     int a = n % 10;
12     n /= 10;
13     while (a != 0)
14     {
15         s.push(a+'0');
16         --a;
17     }
18     int b = n % 10;
19     n /= 10;
20     while (b != 0)
21     {
22         s.push('S');
23         --b;
24     }
25     int c = n % 10;
26     while (c != 0)
27     {
28         s.push('B');
29         --c;
30     }
31     while (!s.empty())
32     {
33         cout << s.top();
34         s.pop();
35     }
36 
37     return 0;
38 }
posted @ 2020-01-09 14:40  Huayra  阅读(420)  评论(0编辑  收藏  举报