Python经典编程习题100例:第85例:999除法

简介: Python经典编程习题100例:第85例:999除法

题目描述:

输入一个奇数,然后判断最少几个 9 除于该数的结果为整数。

解题思路:

> 

代码:

a=int(input())
i=9
count=1
while True:
    if i%a==0:
        break
    else:
        i=i*10+9
        count+=1
print(count)


目录
相关文章
|
1天前
|
存储 Python
【python】习题第10周题解
【python】习题第10周题解
10 1
|
1天前
|
Python
【python】习题 第10周
【python】习题 第10周
7 0
|
1天前
|
Python
【python】习题第9周
【python】习题第9周
12 0
|
1天前
|
数据安全/隐私保护 Python
【python】习题第8周
【python】习题第8周
7 0
|
1天前
|
Python
【python】习题第7周(下)
【python】习题第7周(下)
11 0
|
1天前
|
自然语言处理 Python
【python】习题第7周(上)
【python】习题第7周(上)
12 1
|
1天前
|
Python
【python】习题 6-10周(下)
【python】习题 6-10周(下)
8 0
|
1天前
|
自然语言处理 数据安全/隐私保护 Python
【python】习题 6-10周(中)
【python】习题 6-10周(中)
14 0
|
1天前
|
Python
【python】习题 6-10周(上)
【python】习题 6-10周(上)
8 0
|
1天前
|
Python
【python】习题 1-5周(下)
【python】习题 1-5周(下)
9 0