This commit is contained in:
sherlockforrest
2023-06-20 09:22:53 +08:00
commit bf2ed2e31f
621 changed files with 271599 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
"""
判断输入的正整数是不是回文数
回文数是指将一个正整数从左往右排列和从右往左排列值一样的数
Version: 0.1
Author: 骆昊
Date: 2018-03-02
"""
num = int(input('请输入一个正整数: '))
temp = num
num2 = 0
while temp > 0:
num2 *= 10
num2 += temp % 10
temp //= 10
if num == num2:
print('%d是回文数' % num)
else:
print('%d不是回文数' % num)