1. 判断101~200之间有多少素数? package himi.hebao; /** * (1).编写函数isPrime()用来判断输入数据是否为素数 (2).遍历判断101~200之间的数据是否为素数,并且计数count * * @author Administrator * */ public class TestDemo05 { public static void main(String[] args) { int count = 0; for (int a = 101; a <=…
方法1:from math import * def primeNumber(start,end): num = 0 for i in range(start,end): flag = 0 for j in range(2,int(sqrt(i))+1): if i%j == 0: break else: flag = flag + 1 if flag == len(range(2,int(sqrt(i))+1)): print(i) num = num + 1 print(num) start…