注意:本题求的是某个数的约数的个数大于等于t,不是只有等于t
public class LanQiao79 {
public static void main(String[] args) {
long res = 0;
for (int num = 1; num <= 60; num++) {
res += getNum(num);
}
System.out.println(res);
}
public static int getNum(int num) {//含有num个约数的最小数,注意是大于等于num,不是只有等于num
int temp = 0;//记录约数的个数
for (int i = 1; true; i++) {
temp = 0;
for (int j = 1; j <= i; j++) {
if (i % j == 0) {
temp++;
}
}
if (temp >= num) {
return i;
}
}
}
}