Print Function import math
・問題
Read an integer .
Without using any string methods, try to print the following:
Note that "" represents the values in between.
Input Format
The first line contains an integer .
Output Format
Output the answer as explained in the task.
Sample Input 0
3
Sample Output 0
123
・コメント
サンプルが1,2,3なので、12=1×10+2, 123=12×10+3というように前の数に10をかけて足せばよいと考えたが、1,2,3,・・・・,10などとなった時に、うまくいかなかったので、アルゴリズムを変更した。
の部分aの桁数を求め、それを前の数にかけることによって問題を解決した。
さらに、logの関数を用いれるように最初に
を挿入する必要があることに注意。
・URL