大学生
 
- 金币
- 3017
- 好评
- 10
- 信誉
- 100
|
本帖最后由 天边之云 于 2021-10-11 12:46 编辑
猜猜以下程序所实现的功能:(改正了)
- public class HelloWorld {
- public static void main(String []args) {
- // System.out.println("Hello World!");
- for(int j = 2;j<1000;j++){
- int i = 1;
- boolean isprint = true;
- while(true){
- i++;
- if(i * i > j){
- break;
- }
- if(j % i == 0){
- isprint = false;
- break;
- }
- }
- if(isprint){
- System.out.println(j);
- }
- }
- }
- }
复制代码
|
|