C语言36-100内的素数

#include<stdio.h>

int main()
{
	int i, j;
	bool d;
	for (i = 36; i <= 100; i++)
	{
		d = true;
		for (j = 2; j <= i; j++)
		{
			if (i%j == 0&&i!=j)
			{
				 d = false;
				
			}
			
		}
		if (d)
		{
			printf("%d是素数\n", i);
		}
	}
	while (1);
	return 0;
}

猜你喜欢

转载自blog.csdn.net/suntingsheng123/article/details/89448627
今日推荐