赞
踩
[题解]浙大Python PTA课后习题博客记录(Python)
import math
start,end = map(int,input().split());count = sum = 0
if start == 1: start = 2
for i in range(start,end+1):
temp = int(math.sqrt(i));flag = 0
for j in range(2,temp+1):
if (i%j == 0):
flag = 1;
break
if(flag == 0):
count+=1
sum+=i
print("%d %d" %(count,sum))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。