这是我的代码:
n=int(input())
from math import *
while n!=0:
print (n,"\t",log10(n))
n=n-1
它的输出是:
10 1.0
9 0.9542425094393249
8 0.9030899869919435
7 0.8450980400142568
6 0.7781512503836436
5 0.6989700043360189
4 0.6020599913279624
3 0.47712125471966244
2 0.3010299956639812
1 0.0
我希望它是:
1 0.0
2 0.3010299956639812
3 0.47712125471966244
4 0.6020599913279624
5 0.6989700043360189
.
.
.
9 0.9542425094393249
10 1.0
答案 0 :(得分:2)
n=int(input())
from math import*
for i in range(1,n+1):
print (i,"\t",log10(i))