615 - CS135501_I2P2014_LAB_3 Scoreboard

Time

2014/10/06 16:00:00 2014/10/06 17:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
10097 decimal to ternary

10097 - decimal to ternary   

Description

Input two positive integers, X and Y. The task is to translate the decimal number X into Y digits ternary (三進位) number, and output the Y digits ternary number.

X is smaller than 1000 and Y is smaller than 8.

Input

 Two positive integers, X and Y.  X is smaller than 1000 and Y is smaller than 8.

 

Output

The Y digits ternary representation of the input number X.

Note that you need to print a '\n' at the end of the bit string.

 

Sample Input  Download

Sample Output  Download

Tags

10401HW3



Discuss