主题:请教这个程序怎么才能运行
本程序实现查找并打印1到100之间所有素数的功能。(素数即只
能被1和本身整除的数)
public class test{
[color=FF0000]??????????[/color]{
int lowLimit=1;
int upLimit=100;
[color=FF0000]???????????????[/color];
}
boolean isPrime(int n){
int j = 0;
boolean result ;
result = false;
if (n%2!=0){
j=3;
result=true;
while(j<=Math.sqrt(n)){
if(n%j==0){
[color=FF0000]????????????? [/color];
break;
}
j+=2;
}
}
return result;
}
public void find(int lowLimit,int upLimit){
int i,k=0,p=0;
boolean f;
for(i=lowLimit;i<upLimit;i++){
f=[color=FF0000]?????????????[/color];
if (f){
System.out.println(Integer.toString(i));
}
}
}
[color=FF0000]?????????????????[/color]{
test temp = new test();
}
}
问号的地方怎么写才能实行,谢谢
能被1和本身整除的数)
public class test{
[color=FF0000]??????????[/color]{
int lowLimit=1;
int upLimit=100;
[color=FF0000]???????????????[/color];
}
boolean isPrime(int n){
int j = 0;
boolean result ;
result = false;
if (n%2!=0){
j=3;
result=true;
while(j<=Math.sqrt(n)){
if(n%j==0){
[color=FF0000]????????????? [/color];
break;
}
j+=2;
}
}
return result;
}
public void find(int lowLimit,int upLimit){
int i,k=0,p=0;
boolean f;
for(i=lowLimit;i<upLimit;i++){
f=[color=FF0000]?????????????[/color];
if (f){
System.out.println(Integer.toString(i));
}
}
}
[color=FF0000]?????????????????[/color]{
test temp = new test();
}
}
问号的地方怎么写才能实行,谢谢