哪吒  •  4个月前


include<stdio.h>

int main(void) {

int n, m, c, f, max = 0;
scanf("%d %d", &n, &m);
for (int i = n; i <= m; i++) {
	c = 0;
	for (int j = 1; j * j <= i; j++) {
		if (i % j == 0 && j * j != i) {
			c = c + 2;
		} else if (j * j == i) {
			c++;
		}
	}
	if (max < c) {
		max = c;
		f = i;
	}
}
printf("%d %d", f, max);
return 0;

}


评论:

请先登录,才能进行评论