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/ ...
随机推荐
- 在Ubuntu20中安装Elasticsearch和Kibana6.8.1版本 母胎教学
首先,我们在Ubuntu中安装Elasticsearch6.8.1命令如下: $ docker pull elasticsearch:6.8.1 拉取完成后,创建Elasticsearch6.8.1容 ...
- EasyUI:combotree(树形下拉框)复选框选中父节点(子节点的状态也全部选中)输入框中只显示父节点的文本值
参考: https://blog.csdn.net/weixin_43236850/article/details/100320564
- PAT甲级:1124 Raffle for Weibo Followers (20分)
PAT甲级:1124 Raffle for Weibo Followers (20分) 题干 John got a full mark on PAT. He was so happy that he ...
- PAT乙级:1072开学寄语(20分)
PAT乙级:1072开学寄语(20分) 题干 下图是上海某校的新学期开学寄语:天将降大任于斯人也,必先删其微博,卸其 QQ,封其电脑,夺其手机,收其 ipad,断其 wifi,使其百无聊赖,然后,净面 ...
- 安装geatpy库到指定的conda虚拟环境中
在Anaconda Prompt中输入conda install geatpy,提示找不到这个库: 输入pip install geatpy,安装成功:但是安装在默认conda环境下(以下为pycha ...
- intouch/ifix嵌入视频控件2(报警视频联动初步思路)
在项目中有朋友遇到类似的需求,ifix中嵌入视频,并实现报警与视频的联动功能.诸如,重要设备启动时,摄像头自动弹窗,并持续一段时间自动弹窗关掉:设备故障时,摄像头自动截图,录像一段时间存储:设备停止时 ...
- js学习笔记之正则
() 是为了提取匹配的字符串.表达式中有几个()就有几个相应的匹配字符串.(\s*)表示连续空格的字符串.[]是定义匹配的字符范围.比如 [a-zA-Z0-9] 表示相应位置的字符要匹配英文字符和数字 ...
- Centos LInux 7.0 内核3.1 升级简化流程
Centos LInux 7.0 内核3.1 升级建华流程 1)#导入ELRepo软件仓库的公共秘钥rpm --import https://www.elrepo.org/RPM-GPG-KEY-el ...
- 小白的 Python 修炼手册:入门篇
Life is short, you need Python.(人生苦短,我用 Python.) --Bruce Eckel 前言 听说现在是全民 Python 的时代,虽然不知道事实如何,但学会 P ...
- iTop安装 vm虚拟机、Linux、centos7安装itop 2.6.1
itop安装流程,是我基于下面两位博主发布的文章整理出来的,欢迎大家学习,如有错误之处请大家留言指出我看到之后及时更新.谢谢 https://blog.csdn.net/qq_23565543/art ...