zhishu

来源:互联网 发布:苹果清除app缓存数据 编辑:程序博客网 时间:2024/06/01 07:33
package 网易云java;
import java.util.Scanner;
public class 函数 {
 public static void main(String args[]){
//  Scanner sc= new Scanner(System.in);
//  int t=sc.nextInt();
  int t=3;
  boolean f=false;
  int count=2;
  // 判断素数
  for(int i=3;i<1000;i++)
  { 
   for(int j=2;j<i;j++)
   {
    if(i%j==0)
    {
     f=true;
     break;    
    }else
    { 
     f=false;
     continue;   
    }
   }
   if(f==false){
   System.out.println(i);}
  } 
  
//  if(count==t){
//   System.out.println("是素数");
  }
 }

0 0