解题思路:
注意事项:
参考代码:
def isprime(x): ls=[1,3,7,9] lis=[2,3,5,7] if 1<=x<=10: if x in lis: return 1 else: return 0 if x >= 10: if int(str(x)[-1:]) not in ls: return 0 else: s = 0 for i in range(2,x//2+1): if x%i==0: s += 1 break if s == 0: return 1 else: return 0 def isABA(x): if str(x) == str(x)[::-1]: return 1 a,b=map(int,input().split()) if a>b: a,b=b,a for i in range(a,b+1): if i == 2: print(i) else: if i%2!=0: if isABA(i)==1 and isprime(i)==1: print(i)
0.0分
0 人评分