-4
給定數目
基本上我試圖做的是插入代表除數數量的整數k,然後找到所有的K除數從1-100000計數正整數與除數
#include <stdio.h>
int main(void)
{
int k, x = 1, y = 100000, divisor, count;
printf("Enter the target number of divisors:\n");
scanf("%d", &k);
for (divisor = 0; divisor <= 1; divisor++)
if (x % divisor == 0 && y % divisor == 0)
count++;
printf("There are %d numbers between 1 and 100000 inclusive which have exactly %d divisors\n", k, divisor);
return 0;
}
號碼
但是我似乎無法做到這一點,請幫助我,因爲我對編程場景相當陌生,並且沒有在其他地方找到答案。
輸入'k'的值是什麼意思? – BLUEPIXY 2014-10-27 12:29:51
@BLUEPIXY我們正在搜索的整數除數的數量? – 2014-10-27 12:30:39
@IvayloStrandjev它將被替換而不被使用。 – BLUEPIXY 2014-10-27 12:31:58