判断素数的个数的小程序
2015-10-12 20:06
417 查看
输入n,判断不超过x的素数的个数最大是多少,所以有可能出现输入20,输出27点多。
#include<stdio.h> #include<string.h> #include<math.h> #include<iostream> using namespace std; #define e 2.718281828459 int main(){ double n; while(scanf("%lf",&n)!=EOF){ //double temp1=log10(2)/log10(e); //double temp2=log10(n)/log10(e); //printf("%lf %lf\n",temp1,temp2); printf("%lf\n",6*(log10(2)/log10(e))*n/(log10(n)/log10(e))); } return 0; }
相关文章推荐
- 微信公众平台创建自定义菜单
- 微信支付V3版开发中遇到的一个问题及原因:缺少prepay_id
- 有意思的小程序之悬挂指针
- 使用Bmob云端代码开发微信公众平台教程
- 安卓仿微信朋友圈
- 能挣钱的微信JSSDK+H5混合开发
- 微信公众号unionid问题
- 能挣钱的微信JSSDK+H5混合开发
- 微信公众号添加关注后自动回复图文信息
- 一个统计文件中关键词数量的小程序
- 支付宝 银联 微信支付
- 关于微信支付IWXAPIEventHandler接口中onresp不能调用的问题
- Android端接入微信支付的详细流程
- java 提取微信、手机QQ 等 diskcache 目录文件中的JPG图片数据
- 微信企业号开发(1)WebAPI在回调模式中的URL验证
- 微信oauth2.0授权
- 在线聊天室小程序
- 1.微信密码盒子之密文
- c入门整人小程序
- 微信红包开发