ProjectEuler 004题
1 #include<iostream>
2 using namespace std;
3
4 int main() {
5 bool isPalindromic (int num);
6 int res = 0;
7
8 for(int i = 100; i < 1000 ; i++)
9 for(int j = 100; j < 1000; j++) {
10 if( isPalindromic(i*j) && i*j > res)
11 res = i*j;
12 }
13 cout << res;
14 system("pause");
15 return 0;
16 }
17 //判断回文
18 bool isPalindromic(int num) {
19 int rev_num = 0;
20 int m = num;//商
21 while(m != 0) {
22 rev_num = rev_num * 10 + m%10;
23 m = m/10;
24 }
25 if( rev_num == num)
26 return true;
27 else
28 return false;
29 }
ProjectEuler 004题的更多相关文章
- ProjectEuler 做题记录
退役选手打发时间的PE计划 挂在这里主要是dalao们看到有什么想交流的东西可以私聊哦(站内信或邮箱吧)~~当然现在高三也不怎么能上网. 2017/8/11 595 :第一题QAQ 2017/8/1 ...
- ProjectEuler 005题
题目: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any ...
- ProjectEuler 009题
题目: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For exam ...
- ProjectEuler 008题
题目: The four adjacent digits in the 1000-digit number that have the greatest product are 9 9 8 9 = 5 ...
- ProjectEuler 007题
题目:By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is ...
- ProjectEuler 006题
题目: The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square ...
- ProjectEuler 003题
1 //题目:The prime factors of 13195 are 5, 7, 13 and 29. 2 //What is the largest prime factor of the n ...
- nim也玩一行流,nim版的list comprehension
nim 是一门风格类似python的静态编译型语言,官方网站:http://nim-lang.org 如果你想折腾nim的编辑环境,可以用sublime text3 +插件nimlime,notepa ...
- ProjectEuler && Rosecode && Mathmash做题记录
退役选手打发时间的PE计划 挂在这里主要是dalao们看到有什么想交流的东西可以私聊哦(站内信或邮箱吧) 2017/8/11 PE595 :第一题QAQ 2017/8/12 PE598 2017/ ...
随机推荐
- WLS中Linux与Windows间的环境共享
Reference 更多cmd.exe帮助参考 (cmd_helps)[https://ss64.com/nt/cmd.html] (WSL备份,windows Docker安装)[https://w ...
- odoo里API解读
Odoo自带的api装饰器主要有:model,multi,one,constrains,depends,onchange,returns 七个装饰器. multimulti则指self是多个记录的合集 ...
- 第六篇--MFC美化界面
1.MFC如何设置背景颜色 首先,为对话框添加WM_CTLCOLOR消息,方法为:右击Dialog窗口 --> Class Wizard --> Messages --> WM_CT ...
- MySQL 优化【转】
MySQL常见的优化手段分为下面几个方面: SQL优化.设计优化,硬件优化等,其中每个大的方向中又包含多个小的优化点 下面我们具体来看看~ SQL优化 此优化方案指的是通过优化 SQL 语句以及索引来 ...
- netty系列之:netty中的ByteBuf详解
目录 简介 ByteBuf详解 创建一个Buff 随机访问Buff 序列读写 搜索 其他衍生buffer方法 和现有JDK类型的转换 总结 简介 netty中用于进行信息承载和交流的类叫做ByteBu ...
- 租了一台华为云耀云服务器,却直接被封公网ip,而且是官方的bug导致!
小弟在博客园也有十多个年头了,因为离开了.net圈子,所以很少发文,今天可算是被华为云气疯了.写下这篇文章,大家也要注意自查一下,避免无端端被封公网ip. 因为小弟创业公司业务发展,需要一个公网做宣传 ...
- ASP.NET MVC部署网站到IIS,只列出网站目录
解决办法: 1.重启IIS 打开CMD运行以下代码: ps:根据发布网站的的.NET Framework版本进入对应的目录 4.0版本 C:\Windows\Microsoft.NET\Framew ...
- 自学linux——17.selinux的了解及使用
SElinux是强制访问控制(MAC)安全系统,是linux历史上最杰出的新安全系统.对于linux安全模块来说,SElinux的功能是最全面的,测试也是最充分的,这是一种基于内核的安全系统. 1.S ...
- OpenFaaS实战之八:自制模板(maven+jdk8)
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
- Mybatis源码解析1—— JDBC
在之前的文章中,我为大家介绍了 Mybatis 的详细用法,算是基础教程. 详细链接:Mybatis 基础教程 言归正传,只懂基础可不行,接下来将给大家带来高阶的源码解析教程,从浅入深,通过源码解析, ...