ProjectEuler 009题
题目:
A Pythagorean triplet is a set of three natural numbers, a b
c, for which,
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
代码:
1 #include<iostream>
2 using namespace std;
3
4 int main() {
5
6 for(int i = 1; i < 333; i++){
7 for(int j = 1; j <= 999; j++)
8 for(int k = 1; k <= 999; k++){
9 if((i*i + j*j) == (k*k) && (i+j+k) == 1000)
10 cout << i << " " << j << " " << k << endl;
11 }
12 }
13
14 system("pause");
15 return 0;
16 }
ProjectEuler 009题的更多相关文章
- 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 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 004题
1 #include<iostream> 2 using namespace std; 3 4 int main() { 5 bool isPalindromic (int num); 6 ...
- 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/ ...
随机推荐
- HelloWord!
HelloWorld 1.新建一个文件夹,存放代码 2.新建一个java文件后缀为.java Hello.java (注意后缀 如系统没打开显示后缀需要打开) 3.编写HelloWorld代码 (建议 ...
- org.apache.maven.archiver.mavenarchiver.getmanifest怎么解决——原因就是你的maven的配置文件不是最新的
转载:https://www.cnblogs.com/flytop/p/8933728.html原因就是你的maven的配置文件不是最新的 1.help ->Install New Softwa ...
- Vmware 虚拟机网络通讯
VMware Workstation(中文名"威睿工作站")是一款功能强大的桌面虚拟计算机软件,提供用户可在单一的桌面上同时运行不同的操作系统,和进行开发.测试 .部署新的应用程序 ...
- tomcat与springmvc 结合 之---第20篇 springmvc 对于加载的bean对象存储在哪里
是
- nexus 私服 设置本公司代理 记录
index成功
- navicat连接MySQL数据库出现Authentication plugin 'caching_sha2_password的问题
1.以管理员身份运行cmd终端,cd 到mysql安装目录的bin文件夹下面 输入mysql -u root -p,回车键后输入密码登录mysql 依次输入一下三条命令: ALTER USER 'ro ...
- 自制车速记录仪「GitHub 热点速览 v.21.31」
作者:HelloGitHub-小鱼干 如果你有一辆普通的自行车,那么就可以使用下 X-TRACK 这个项目制作一个自己的测速器,记录你的行驶轨迹还有车速,体验一把硬件发烧友的乐趣.如果你有一个非 ma ...
- Joomla 3.4.5 反序列化漏洞(CVE-2015-8562)
影响版本 Joomla 1.5.x, 2.x, and 3.x before 3.4.6 PHP 5.6 < 5.6.13, PHP 5.5 < 5.5.29 and PHP 5.4 &l ...
- window.location.href下载文件,文件名中文乱码处理
下载文件方法: window.location.href='http://www.baidu.com/down/downFile.txt?name=资源文件'; 这种情况下载时:文件名资源文件会中文乱 ...
- 造轮子系列之RPC 1:如何从零开始开发RPC框架
前言 RPC 框架是后端攻城狮永远都绕不开的知识点,目前业界比较知名有 Dubbo.Spring Cloud 等.很多人都停留在了只会用的阶段,作为程序猿,拥有好奇心深入学习,才能有效提高自己的竞争力 ...