from math import sqrt j =2 whilej <=100: i =2 k = sqrt(j) while(i<=k): ifj%i ==0:break i = i+1 if(i > k): printj, j+=1 使用for循环和break: frommathimportsqrt foriinrange(2,101): flag =True k =int(sqrt(i)) forjinrange(2,k+1): ifi % j ==0: flag =0 b...
from math import sqrt j =2 whilej <=100: i =2 k = sqrt(j) while(i<=k): ifj%i ==0:break i = i+1 if(i > k): printj, j+=1 使用for循环和break: frommathimportsqrt foriinrange(2,101): flag =True k =int(sqrt(i)) forjinrange(2,k+1): ifi % j ==0: flag =0 b...
from math import sqrt j =2 whilej <=100:i =2 k = sqrt(j)while(i<=k):ifj%i ==0:break i = i+1 if(i > k):printj,j+=1 使用for循环和break:frommathimportsqrt foriinrange(2,101):flag =True k =int(sqrt(i))forjinrange(2,k+1):ifi % j ==0:flag =0 break...