摘要: 写法1: #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> void shift(int* isPrime, int n, int i) { for (int j = 2 * i; j < n; j += 阅读全文
posted @ 2021-10-31 02:39 Grit_L。 阅读(52) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> using namespace std; int GCD(int x, int y) {//求两个数的最大公因数;可改为bool类型函数,判断x,y是否为素数即可; return y == 0 ? x : GCD(y, x % 阅读全文
posted @ 2021-10-31 02:29 Grit_L。 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 方法1:穷举 #include<iostream> using namespace std; int main(){ int m = 123,i;//求11mod123的逆元 for (i = 2; (11*i-1)%123!=0; i++); cout << i; system("pause"); 阅读全文
posted @ 2021-10-31 00:49 Grit_L。 阅读(65) 评论(0) 推荐(0) 编辑