
C++
初学知识积累
不爱研究的研究僧
这个作者很懒,什么都没留下…
展开
-
const修饰指针
https://www.cnblogs.com/tanshengjiang/p/14320182.html原创 2021-07-15 16:10:04 · 76 阅读 · 0 评论 -
投骰子的随机游戏
游戏说明:每个骰子有六面,点数分别为1,2. 3.4,5、6游戏者在程序开始时输入一个无符号整数,作为产生随机数的种于每轮投两次骰子,第一轮如果和数为7或11则为胜,游戏结束;和数为2、3或12则为负,游戏结束;和数为其它值则将此值作为自己的点数,继续第二轮、第三轮.直到某轮的和数等于点数则取胜,若在此前出现和数为7则为负#include <iostream>#include <cstdlib> using namespace std;int rollDice();enum原创 2020-11-11 18:18:19 · 1363 阅读 · 0 评论 -
寻找并输出11~999之间的数m,满足m、m平方、m三次方为回文数
#include <iostream>using namespace std;bool symm(unsigned n);unsigned power(unsigned x, unsigned y);int main() { for (int i = 11; i <= 999; i++) { unsigned a, b, c; a = power(i, 1); b = power(i, 2); c = power(i, 3); if(symm(a)&&原创 2020-11-11 16:01:55 · 1476 阅读 · 0 评论