Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <conio.h>
- #include <math.h>
- #include <windows.h>
- using namespace std;
- long long int m1, m2, m3, m4, ilor, ma1, ma2, ma3, ma4,x1,x2,x3,x4,wynik,wynik2;
- int main()
- {
- cout << "Celem programu jest konwersja odwrotna " << endl;
- cout << "podaj wartosc m1" << endl;
- cin >> m1;
- cout << "podaj wartosc m2 " << endl;
- cin >> m2;
- cout << "podaj wartosc m3" << endl;
- cin >> m3;
- cout << "podaj wartosc m4 " << endl;
- cin >> m4;
- cout << "podaj wartosc x1" << endl;
- cin >> x1;
- cout << "podaj wartosc x2 " << endl;
- cin >> x2;
- cout << "podaj wartosc x3" << endl;
- cin >> x3;
- cout << "podaj wartosc x4 " << endl;
- cin >> x4;
- ilor = m1*m2*m3*m4;
- ma1 = ilor* pow(m1 ,-1);
- ma2 = ilor* pow(m2, -1);
- ma3 = ilor* pow(m3, -1);
- ma4 = ilor* pow(m4, -1);
- wynik = (ma1*(ma1%m1)*x1 + ma2*(ma2%m2)*x2 + ma3*(ma3%m3)*x3*(ma4%m4)*x4);
- wynik2 = wynik % ilor;
- ////{
- //// if ((a*b*c*k) % d == 1)
- ////break;
- /////
- //////}
- cout << "wynik to : " << wynik2<< endl;
- Sleep(10000);
- return 0;
- cin.get();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement