2021年8月24日

摘要: #include<stdio.h> #include<math.h> int Prime(int n)//判断素数的工具(8以上有效) { for (int i = 2; i <= int(sqrt(n)); i ++) while (n% i == 0 ) return 0; return 1; 阅读全文
posted @ 2021-08-24 13:45 OopsOops 阅读(48) 评论(0) 推荐(0)
 
摘要: #include <stdio.h> #include<math.h> int power(int b)//定义幂函数 { int i = 2, j = 1; if (b == 0) i = 1; for (; j < b; j++) i = 2 * i; return i; } int Sum(i 阅读全文
posted @ 2021-08-24 13:42 OopsOops 阅读(604) 评论(0) 推荐(0)
 
摘要: #include<stdio.h> int div(int array[4], int b) { int c = 0, i = 3;//细节 while (b > 0) { c = b % 10; array[i] = c; b = b / 10; i--; } return 0; } void M 阅读全文
posted @ 2021-08-24 13:39 OopsOops 阅读(218) 评论(0) 推荐(0)