jackchai @ 2019-09-09 08:55:11
import java.util.Scanner;
public class Main{
public static Boolean is_Prime(int n) //判断一个数是否为质数
{
for(int i=2;i*i<=n;i++)
{
if(n%i==0)
return false;
}
return true;
}
public static void main(String[] args)
{
Scanner in=new Scanner(System.in);
int a=in.nextInt();
int[] b=new int[3];
int o=0;
for(int i=2;i<a;i++)
{
for(int h=2;h<a;h++)
{
int k=a-i-h;
if((k>=2)&&is_Prime(i)&&is_Prime(h)&&is_Prime(k))
{
System.out.println(i+" "+h+" "+k);
o++;
break;
}
}
if(o==1)
break;
}
}
}
by Kevin_Wa @ 2019-09-09 09:26:47
So?
by pzc2004 @ 2019-09-09 09:44:07
%%%
by MiKu_Yin @ 2019-09-09 10:18:55
Java巨佬Orz
by cszmc2004 @ 2019-09-09 11:38:20
?
by qwqqwq_qwqqwq @ 2019-09-09 11:53:34
为什么要用Boolean而不用boolean?
前者是后者的对象包装类(引用类型),还是用后者吧