⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sl306.cpp

📁 Visual C++ 的学习资料一
💻 CPP
字号:
// sl306.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream.h"
#include "cmath"

int main()
{
	int num=101,kf,i=2;
	cout<<"输出100~200间的全部素数:"<<"\n";
	while(num <= 200)
	{
		kf = sqrt(num);
		while(i <= kf)
		{
			if(num%i == 0)
			{
				break;
			}
			i++;
		}
		if(i > kf)
		{
			cout<<num<<"\t";
		}
		i = 2;
		num = num + 2;
	}
	cout<<"\n";
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -