basically what i was trying to do is insert an integer k that represents the number of divisors and then finding all the numbers that have k divisors from 1-100000
#include <stdio.h>
int main(void)
{
int k, x = 1, y = 100000, divisor, count;
printf("Enter the target number of divisors:
");
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
", k, divisor);
return 0;
}
However I can't seem to be able to do it, please do help me as I'm fairly new to the programming scene and haven't found an answer elsewhere.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…