随笔分类 -  C++

C++ Language
“山无棱,天地合,乃敢与君绝”的数学表示(附C++代码)
摘要:本人发现20017002是“山无棱,天地合,乃敢与君绝”的数学表示。为什么呢?首先,从形上看,1和7是咬合的,然后头尾是回环的。其次,从性质上看,20017002可分解为2x3x3336167,取3336167,3336167是第239293个素数,239293是第21165个素数,21165分解成 阅读全文

posted @ 2021-12-01 19:29 飞凤颖悟绝伦 阅读(294) 评论(0) 推荐(0)

生物进化模拟器(C++)
摘要:#include <iostream> #include <cstdlib> #include <ctime> using namespace std; /* run this program using the console pauser or add your own getch, syste 阅读全文

posted @ 2021-11-07 18:46 飞凤颖悟绝伦 阅读(206) 评论(0) 推荐(0)

关于十二生肖的数学发现(C++)
摘要:把数字看成是年份,然后根据生肖赋值。这里把鼠年赋值为1,牛年赋值为2,虎年赋值为3,兔年赋值为4,龙年赋值为5,蛇年赋值为6,马年赋值为7,羊年赋值为8,猴年赋值为9,鸡年赋值为10,狗年赋值为11,猪年赋值为12。比如数字1,我们把它看成是公元1年,公元1年是鸡年,赋值10,用1和10做差得绝对值 阅读全文

posted @ 2021-10-17 11:30 飞凤颖悟绝伦 阅读(867) 评论(0) 推荐(1)

随机生成文章的AI(C++)
摘要:#include <iostream> #include <cstdlib> #include <ctime> #include <fstream> using namespace std; const int n = 40; const int m = 66; const int lenth = 阅读全文

posted @ 2021-10-08 09:10 飞凤颖悟绝伦 阅读(140) 评论(0) 推荐(0)

自然数与质数做商结果的探究
摘要:#include <iostream> #include <cmath> #include <fstream> using namespace std; /* run this program using the console pauser or add your own getch, syste 阅读全文

posted @ 2021-08-21 14:16 飞凤颖悟绝伦 阅读(176) 评论(0) 推荐(0)

写学习abcde的简单AI(C++实现)
摘要:#include <iostream> #include <time.h> #include <stdlib.h> #include <cmath> using namespace std; #define random(a,b) (rand() % (b-a+1))+ a /* run this 阅读全文

posted @ 2021-08-09 17:22 飞凤颖悟绝伦 阅读(334) 评论(0) 推荐(0)

舌头算法的C++实现
摘要:观察生活,我们不难发现,吃饭的时候,有时候左边的东西会到右边来,这是为什么呢?就是舌头的作用了。 下面的代码将模拟舌头的运动: #include <iostream> #include <cstdlib> #include <time.h> #define random(a,b) (rand()%( 阅读全文

posted @ 2021-08-05 12:02 飞凤颖悟绝伦 阅读(78) 评论(0) 推荐(0)

如何用程序随机出游戏王180张不重复的卡片
摘要:首先,我们要下载ygopro,进入到里面的pics目录。 可以看到这里的卡片是用编号命名的,我们的目的是要弄到图片的编号,因为有编号就能通过编号查到那张卡。 我们新建一个txt文档,输入如下代码: dir /a-d /b>scr.txt echo Topbook 文件名已导出! pause 然后把该 阅读全文

posted @ 2021-08-01 06:42 飞凤颖悟绝伦 阅读(333) 评论(0) 推荐(0)

如何解决一道用最小步数处理字符串折叠问题?
摘要:突然想到一个数学问题,一串数字经过折叠后,可能会出现连连看的情况,那么如何用最小步数判断这串数字经过不同的折叠后有多少种会出现连连看的情况? #include <iostream> #include <cmath> #include <time.h> using namespace std; con 阅读全文

posted @ 2021-04-02 14:47 飞凤颖悟绝伦 阅读(78) 评论(0) 推荐(0)

不知一点而知所有
摘要:探究有一道数学题不知道,是否能从而知道全部。上代码: #include <cstdlib> #include <iostream> #include <ctime> #include <sstream> using namespace std; #define random(a,b) (rand() 阅读全文

posted @ 2020-10-12 10:49 飞凤颖悟绝伦 阅读(167) 评论(0) 推荐(0)

借助C++探究素数的分布
摘要:这里使用的区间是36,144,576,2304,9216,36864,147456,589824,2359296,9437184。至于这个区间是怎么得到的,感兴趣的同鞋可前往(https://www.cnblogs.com/chanji/p/12808117.html)观看。 首先附上程序: #in 阅读全文

posted @ 2020-10-06 09:34 飞凤颖悟绝伦 阅读(210) 评论(0) 推荐(0)

一个比较问题
摘要:(一)一个比较问题: 一个人想每天努力多一点。 (二)对比较问题的模拟: 一个人在第一天画一个正方形 (图4-1) 在第二天画两个正方形 (图4-2) 在第三天画三个正方形 (图4-3) 。。。。。。 在第n天画n个正方形 (图4-4) (三)关于比较问题的模拟的疑问 那个人在第一天之后是否在原来的 阅读全文

posted @ 2020-08-30 10:06 飞凤颖悟绝伦 阅读(255) 评论(0) 推荐(0)

饼图问题
摘要:不难发现,9和8,8和7,7和6等等制饼图,会呈现不同的比例,但是这些都是相差1的。这里我们用C++程序跑一遍。 int main(){ int sum = 0; double temp1; double temp2; for(int i = 1;i < 10000;++i) { sum = i + 阅读全文

posted @ 2020-06-11 15:31 飞凤颖悟绝伦 阅读(212) 评论(0) 推荐(0)

用C++验证三门问题
摘要:三门问题(换门): #include <iostream> #include <cstdlib> #include <ctime> #define random(a,b) (rand() % (b-a+1))+ a using namespace std; int main() { srand((i 阅读全文

posted @ 2020-05-21 11:08 飞凤颖悟绝伦 阅读(763) 评论(0) 推荐(0)

用C++模拟蚊子的运动来检验概率论内容
摘要:背景:在一个很大的方形透明容器内,从某个位置放入适量的蚊子,等待几分钟后观察蚊子的分布. #include <iostream> #include <cstdlib> #include <ctime> #define random(a,b) (rand() % (b-a+1))+ a using n 阅读全文

posted @ 2020-05-02 16:36 飞凤颖悟绝伦 阅读(368) 评论(0) 推荐(0)

矩阵类的代码(C++)
摘要:The Codes of Matrix ClassMatrix.h:#ifndef MATRIX_H#define MATRIX_H #include #include #include #include #include"MatrixTypedef.h"// declare typedef's h... 阅读全文

posted @ 2015-04-08 21:48 飞凤颖悟绝伦 阅读(2024) 评论(0) 推荐(0)

导航