摘要: `int main() { //水仙花数是指一个3位数,它的每个位上的数字的三次幂之和等于它本身 //1.将所有三位数输出(100-999) int num = 100; do { //2.在所有三位数中找到水仙花数 int a = 0;//个位 int b = 0;//十位 int c = 0;/ 阅读全文
posted @ 2020-10-15 16:39 大西柚咬一口 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1、 rand 1.1 rand生成的随机数是伪随机数 1.2 rand() % 100 生成0-99的随机数,若想要1-100的随机数,则可rand() % 100 + 1; 2、srand 2.1 srand的含义:添加随机数种子 作用:利用当前系统时间生成随机,防止每次随机数都一样 2.2 使 阅读全文
posted @ 2020-10-15 11:27 大西柚咬一口 阅读(103) 评论(0) 推荐(0) 编辑