Let us use the letter B to denote "hundred", the letter S for "Ten", "12...N" to represent the single digit n (<10), in a different format to output any of the 3-bit positive integer. For example, 234 should be output as BBSSS1234, because it has 2 "hundred", 3 "ten", and a single digit of 4.
input Format: each test input contains 1 test cases, giving a positive integer n (<1000).
Output format: one row for each test case output n in the specified format.
Input Sample 1:
234
Output Example 1:
BBSSS1234
Input Sample 2:
23
Output Example 2:
SS123
1#include <stdio.h>2 intMain ()3 {4 intn,i;5scanf"%d",&N);6 if(n>= -)7 {8 for(i=1; i<=n/ -; i++)9 {Tenprintf"B"); One } An=n% -; - } - if(n>=Ten) the { - for(i=1; i<=n/Ten; i++) - { -printf"S"); + } -n=n%Ten; + } A for(i=1; i<=n;i++) at { -printf"%d", i); - } -printf"\ n"); - return 0; -}
Pat B 1006. Output integers in a different format (15)