一、N-S流程图;
二、运行结果;
三、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
int main()
{
//初始化变量值;
int n = 100;
int i = 0;
int result = 0;
//嵌套循环判断100~200之间的质数;
for (n = 100; n <= 200; n++)
{
//循环判断;
for (i = 2; i < n; i++)
{
//运算;
result = n % i;
//判断;
if (result == 0)
{
//跳出循环;
break;
}
}
//判断;
if (result == 0)
{
}
else
{
//输出结果;
printf("%d\n", n);
}
}
return 0;
}