PAT 1006. 换个格式输出整数 (15)
代码
#include<bits/stdc++.h> using namespace std; int main() { int n,a,b,c,t; scanf("%d",&n); a=n/100; t=n%100; b=t/10; c=t%10; for(int i=0;i<a;i++) { printf("B"); } for(int i=0;i<b;i++) { printf("S"); } for(int i=1;i<=c;i++) { printf("%d",i); } printf("\n"); return 0; }
anytime you feel the pain.hey,refrain.don't carry the world upon your shoulders