Problem L: 输出200-299之间的所有素数
#include<stdio.h>
#include<math.h>
int main()
{
int count,m,n,i;
count=;
for(m=;m<;m++)
{
n=sqrt(m);
for(i=;i<=n;i++)
if(m%i==)
break;
if(i>n)
{
count++;
if(count%==)
printf("%3d",m);
if(count%!=)
printf("%4d",m);
if(count%==)
printf("\n");
}
}
printf("\n");
return ;
}
Problem L: 输出200-299之间的所有素数的更多相关文章
- HDU 6330.Problem L. Visual Cube-模拟到上天-输出立方体 (2018 Multi-University Training Contest 3 1012)
6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1 ...
- Gym 102056L - Eventual … Journey - [分类讨论][The 2018 ICPC Asia-East Continent Final Problem L]
题目链接:https://codeforces.com/gym/102056/problem/L LCR is really an incredible being. Thinking so, sit ...
- The Ninth Hunan Collegiate Programming Contest (2013) Problem L
Problem L Last Blood In many programming contests, special prizes are given to teams who solved a pa ...
- Problem L
Problem Description 在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: L&qu ...
- 2018 Multi-University Training Contest 4 Problem L. Graph Theory Homework 【YY】
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Problem L. Graph Theory Homework Time Limit: 2000 ...
- 华农oj Problem L: CreatorX背英语【STL】
Problem L: CreatorX背英语 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 53 Solved: 36 [Submit][Status][ ...
- hdu6437 Problem L.Videos(网络流)
Problem L.Videos Problem Description: C-bacteria takes charge of two kinds of videos: ’The Collectio ...
- 代码实现:判断101-200之间有多少个素数(质数),并输出所有素数。 程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除,则表明此数不是素数,反之是素数。
package com.loaderman.Coding; /* 判断101-200之间有多少个素数(质数),并输出所有素数. 程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能 ...
- python基础练习题(题目 判断101-200之间有多少个素数,并输出所有素数。)
day7 --------------------------------------------------------------- 实例012:100到200的素数 题目 判断101-200之间 ...
随机推荐
- (转)Python中实现带Cookie的Http的Post请求
转自crifan: http://www.crifan.com/python_http_post_request_with_cookie/ . . . .
- c#之字符串函数
1.常用的字符串函数 Compare 比较字符串的内容,考虑文化背景(场所),确定某些字符是否相等 int Compare(string str1,string str2) int Compare(s ...
- Quartus ModelSim联合仿真中的RAM初始化
Modelsim只支持Hex格式的初始化文件,文件需要放在仿真的根目录下,例如:.\simulation\modelsim:并且在利用Quartus宏生成IP时,选择的初始化文件必须用绝对路径!否则M ...
- [BZOJ1004] [HNOI2008]Cards解题报告(Burnside引理)
Description 小春现在很清闲,面对书桌上的N张牌,他决定给每张染色,目前小春只有3种颜色:红色,蓝色,绿色.他询问Sun有多少种染色方案,Sun很快就给出了答案.进一步,小春要求染出Sr张红 ...
- 时间模块(time/date)
在Python中,常用的表示方式的时间有:时间戳,字符串时间,元组时间(既年,月,日,时,分,秒,周几,一年中的第几天,时区) time模块: time.timezone: 获取当前标准时 ...
- POJ3264(线段树求区间最大最小值)
Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 41162 Accepted: 19327 ...
- react+webpack+babel+eslint+redux+react-router+sass 环境快速搭建
本文中的例子支持webpack-dev-server自动刷新及react热替换,使用了redux管理state,用react-router切换路由,用babel实现ES6语法书写,同时支持async/ ...
- Laravel项目使用腾讯云对象存储上传图片(cos-php-sdk-v5版本)
为了加快网站访问速度.降低网站负载,现在越来越多的网站选择把图片等静态文件放在云上,这里介绍一下腾讯云对象存储在Laravel项目中的使用 1.申请腾讯云对象存储.创建Bucket.获取APPID等参 ...
- Laravel5.5新特性
1.新的报错页面 报错更加美观,并标记显示出错误的代码 2.包的自动配置 在conposer.json文件中加入包中的配置,下载后就会自动配置到app.php 文件中,使用更方便 在之前的 Larav ...
- Asp.Net MVC在过滤器中使用模型绑定
废话不多话,直接上代码 1.创建MVC项目,新建一个过滤器类以及使用到的实体类: public class DemoFiltersAttribute : AuthorizeAttribute { pu ...