代码实现:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int N, *array = (int*)malloc(sizeof(int) * 10334), cnt = 0;
scanf("%d", &N);
for (int i = 0; i < 10334; i++)
array[i] = 0;
for (int i = 1; i <= N; i++)
array[i / 2 + i / 3 + i / 5]++;
for (int i = 0; i < 10334; i++)
if (array[i] != 0)
cnt++;
printf("%d", cnt);
return 0;
}