31 lines
539 B
Java
31 lines
539 B
Java
package LanQiaoOJ;
|
||
/*
|
||
* 问题描述
|
||
任何一个大于1的正整数都能被分解为若干个质数相
|
||
乘,比如28=2×2×7被分解为了三个质数相乘。
|
||
请问在区间[2333333,23333333]中有多少个正整数
|
||
可以被分解为12个质数相乘?*/
|
||
public class 数数 {
|
||
static int ans=0;
|
||
public static void main(String[] args) {
|
||
for(int i=2333333;i<2333333;i++) {
|
||
int t=i;
|
||
|
||
int x=0;
|
||
for(int j=2;j<j/t;j++) {
|
||
while(t%j==0) {
|
||
x++;
|
||
t/=j;
|
||
}
|
||
}
|
||
if(t>1) {
|
||
x++;
|
||
}
|
||
if(x==12)
|
||
ans++;
|
||
}
|
||
System.out.print(ans);
|
||
}
|
||
|
||
}
|