连续因子(20分)
- 题目
- 题解
import java.util.Scanner;
public class F006 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int num=input.nextInt();
for (int i=2;i<=Math.sqrt(num);i++) {
int product=1;
int count=0;
int j=i;
while (product <= num) {
count++;
product=product*j*count;
j++;
if (product==num){
System.out.println(count);
for (int p=0;p<count;p++)
if (p!=count-1)
System.out.print((i+p)+"*");
else
System.out.print(i+p);
return;
}
product=product/count;
}
}
}
}