Let's use B
the letter to denote "hundred", the letter S
means "Ten", 12...n
to represent a non-zero digit n
(<), in a different format to output any of the 3-bit positive integers. For example 234
, it should be output 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 (<).
output Format:
The output of each test case is one line, and n is output in the specified format .
Input Sample 1:
234
Output Example 1:
BBSSS1234
Input Sample 2:
23
Output Example 2:
SS123
Analysis:
Three digits according to the hundred, 10 bits, you store
Convert to the corresponding rule output
1 /*C*/2#include <stdio.h>3 intMain ()4 {5 intn,i,m;6scanf"%d",&n);7m = n/ -;8N%= -;9 for(i=0; i<m;i++)TenPutchar ('B'); Onem = n/Ten; AN%=Ten; - for(i=0; i<m;i++) -Putchar ('S'); the for(i=1; i<=n;i++) -Putchar (i+ -); - return 0; - } +
pat-Serie B-1006 output integers in a different format