#include<stdio.h>
#include<math.h>
#define N 10
int main()
{
	char a, b[N], c, d, e, f, g;
  v:d = 0;	printf("\n欢迎使用,请输入最大6000数推算位7素数");
	scanf("%d", &c);
	for (e = 7; 0 < c - e; e += 10)
	{
		a += 1;
		/* 位7 */
		if (e % 3 == 0)
			d += 1;
		else
		{
			if (98000 < e)
			{
				g += 1;
			};
			f += 1;
			b[f] = e;
		}
	}
	e = 0;
printf("\n推算出98000范围以上%d次\n推算出%d范围内有%d个个位为7,其中素数有\n", g,c, a);
	while (0 < d + a - e)
	{
		e += 1;
		if (e % 5 == 0)
			printf("\n");
		if (b[e] != 1)
			printf("%.d,", b[e]);
		else
			break;
	}
	goto v;
}