#P0024. 7进制
7进制
1. Description
In math class we usually use decimal system, which means the number a on i-th position represents
For example, the number 2 in 23 represents
Similarly, in septenary (Base-7) system, the number a on i-th position represents
Only 0~6 are allowed on digit. Once the number reaches 7, it carries to next position. To convert a septenary number to a decimal one, we can make a calculation
In this question, we'd like to code a function base7(), which takes a decimal number as input and convert it to a septenary representation.
2. Input & Output
Input:
- A decimal integer
- Use
input()as input. Notice that the value you get frominput()is a string
Output:
- A septenary integer
- Use
print()for your output
Example
# Input:
40
# Output:
55
# Input:
-7
# Output:
-10