完美数字_华为SO挑战赛2015年8月
2015-09-02 12:20
155 查看
[align=left] [/align]
#include<iostream> using namespace std; int main() { int small,big; cin>>small>>big; int MinPerfectNum = 30;//2*3*5 int PerfectNum = 30; int NumOfPerfectNum = 0; for(; PerfectNum >= small && PerfectNum <= big;PerfectNum++) { if (PerfectNum % 2==0 && PerfectNum %3 == 0&& PerfectNum %5 == 0) { NumOfPerfectNum++; } } cout<<NumOfPerfectNum<<endl; system("pause"); return 0; }
相关文章推荐
- linux sysctl.conf中相关重要设定的详细说明
- grep正则表达式
- OpenCV绘制图像的水平和竖直方向直方图
- LeetCode Remove Duplicates from Sorted List
- set_intersection
- LeetCode Remove Duplicates from Sorted List
- JQuery+AJax - 无刷新使用验证码
- 详解 QT 源码之 Qt 事件机制原理
- 一个程序员的基本素质
- 冒泡排序
- 关于响应式布局的字体大小设置
- [LeetCode] Maximal Rectangle
- Swift2学习笔记(2)
- Unity5内部渲染的优化1:介绍
- s5pv210的外部中断
- 【前端学习笔记】2015-09-02~~~~ 关于filter()匹配的使用
- linux 防火墙
- Qt的signal/slot机制原理
- java String.format() 字符串格式化
- Vim 使用入门 -- 转载保存