int Mod_Exp(){
cout <<"此函数为a的b次方对m求模,请依次输入a、b、m:"<< endl;
int a, b, m, ans =0;
cin >> a >> b >> m;for(int i =0; i < b; i++){
a *= a;}
ans = a % m;return ans;}
求乘法逆元函数
int Mul_Inverse(){
cout <<"此函数为求a模m的乘法逆元,请依次输入a、m:"<< endl;
int a, m;
cin >> a >> m;
int x =1;
int y =0;
int origM = m;while(a >1){
int q = a / m;
int temp = m;
m = a % m;
a = temp;
temp = y;
y = x - q * y;
x = temp;}if(x <0){
x += origM;}if(x <0){
cout <<"乘法逆元不存在"<< endl;}else
cout <<"答案是:"<< x << endl;return x;}