【PAT B1006】换个格式输出整数(C语言)
#include <stdio.h> int main() { int x,b,s,g,i=1; scanf("%d", &x); b = x / 100; s = x / 10 % 10; g = x % 10; while (b) { printf("B"); b--; } while (s) { printf("S"); s--; } while (g) { printf("%d", i); i++; g--; } return 0; }