public class Example01{
public static void main(String[] args ){
int n=98;
show(n);
}
private static void show(int n){
System.out.print(n+"=");
for(int i=2;i<n+1;i++){
while(n%i==0&&n!=i){
n/=i;
System.out.print(i+"*");
}
}
if(n==i){
System.out.print(i);
break;
}
}
}
请问while语句那改成if语句可以吗
while是循环,这里if没办法满足需求吧!