PAT (Basic Level) Practice (中文)1006 换个格式输出整数 (15 分)

题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805318855278592

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <string>
 4 #include <cstring>
 5 #include <algorithm>
 6 #include <stack>
 7 using namespace std;
 8 int n;
 9 int main()
10 {
11        while(cin>>n){
12            int a=n/100;
13            int b=(n-100*(a))/10;
14            int c=n%10;
15            for(int i=1;i<=a;i++){
16                cout<<'B';
17            } 
18            for(int i=1;i<=b;i++){
19                cout<<'S';
20            }
21            for(int i=1;i<=c;i++){
22                    cout<<i;
23            }
24            cout<<endl;
25        }
26     return 0;
27 }

 

上一篇:Struct_graph&practice_190705


下一篇:Codeforces 1076F Summer Practice Report dp