g[] args){Р final int NUMBER_OF_PRIMES = 100;//素数的个数Р final int NMBER_OF_PRIMES_PER_LINE = 10;//每行10个数。Р int count = 1;Р int number = 2;Р System.out.println("The first prime number numbers are \n");// Р while(count <= NUMBER_OF_PRIMES){Р if(isPrime(number)){Р if(number<10)Р System.out.print(" ");Р else if(number<100)Р System.out.print(" ");Р //每行输出10个Р if(count % NMBER_OF_PRIMES_PER_LINE == 0){Р System.out.println(number);Р }else{Р System.out.print(number + " ");Р }Р count ++;Р }Р number ++;Р }Р }Р public static boolean isPrime(int number){Р boolean isPrime = true;Р for(int divisor = 2;divisor <= number/2; divisor++){Р if(number % divisor == 0){Р isPrime = false;break;Р }Р }Р return isPrime;Р }Р?}?Р三、结论Р1、实验结果Р 截图如下:Р2、分析讨论Р Р 这个题目比前面两个题目复杂一些,多了每行输出10个数的规定,但整体来说不难,不过还是要仔细思考问题和耐心的编程,做事情要专注。