求1到100素数之和
sum =0
for i in range(2,101):
for j in range(2,i):
if i%j==0:
break
else:
sum = sum + i
print('1-100之间素数和为:%d' %sum)
求1到100素数之和
sum =0
for i in range(2,101):
for j in range(2,i):
if i%j==0:
break
else:
sum = sum + i
print('1-100之间素数和为:%d' %sum)