脑残法计算a对模数m的阶

2019-04-13 12:12发布

#include #include #include using namespace std; unsigned long int a[10000]={2}, num=1; unsigned long int j=0; int max_gongyue(int num1,int num2) { int temp,m,n; if(num1>1, n); t = t*t % n; if (b&0x1) { t = t*a % n; } return t; } int main() { cout<<"计算 ordm(a)"<>m>>a) { if(max_gongyue(a,m)!=1) { cout<<"a和m不互素!"<