public class Gedebahe { public static void main(String[] args) { int num=Integer.parseInt(args[0]); if(num<=6) { System.out.println("参数错误!"); return; } if(num%2!=0) { System.out.println("参数错误!"); return; } Gedebahe g=new Gedebahe(); for(int i=3;i<=num/2;i++) { if(i%2==0) { continue; } if(g.isPrime(i) && g.isPrime(num-i)) { System.out.println(i+"+"+(num-i)+"="+num); } } } }
相关分类