在这里插入代码
#include
using namespace std;
int main()
{
int a, b, p, q, x=0;
cout << "x≡a(mod p) x≡b(mod q) " << " " << endl;
cout << “please input a b p q” << endl;
cin >> a >> b >> p >> q;
int p1=0, q1=0, n;
while (p * p1 % q != 1) {
p1++;
}
while (q * q1 % p != 1) {
q1++;
}
x = (a * q * q1 + b * p * p1) % (p * q);
cout << p1 << endl;
cout << q1 << endl;
cout << x << endl;
}
作业11.24
最新推荐文章于 2023-12-08 11:20:02 发布