Advertisement
Guest User

konwersja odwrotna

a guest
Apr 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include<iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4. #include <windows.h>
  5. using namespace std;
  6.  
  7. long long int m1, m2, m3, m4, ilor, ma1, ma2, ma3, ma4,x1,x2,x3,x4,wynik,wynik2;
  8. int main()
  9. {
  10. cout << "Celem programu jest konwersja odwrotna " << endl;
  11.  
  12. cout << "podaj wartosc m1" << endl;
  13. cin >> m1;
  14. cout << "podaj wartosc m2 " << endl;
  15. cin >> m2;
  16. cout << "podaj wartosc m3" << endl;
  17. cin >> m3;
  18. cout << "podaj wartosc m4 " << endl;
  19. cin >> m4;
  20.  
  21.  
  22. cout << "podaj wartosc x1" << endl;
  23. cin >> x1;
  24. cout << "podaj wartosc x2 " << endl;
  25. cin >> x2;
  26. cout << "podaj wartosc x3" << endl;
  27. cin >> x3;
  28. cout << "podaj wartosc x4 " << endl;
  29. cin >> x4;
  30.  
  31. ilor = m1*m2*m3*m4;
  32. ma1 = ilor* pow(m1 ,-1);
  33. ma2 = ilor* pow(m2, -1);
  34. ma3 = ilor* pow(m3, -1);
  35. ma4 = ilor* pow(m4, -1);
  36.  
  37.  
  38. wynik = (ma1*(ma1%m1)*x1 + ma2*(ma2%m2)*x2 + ma3*(ma3%m3)*x3*(ma4%m4)*x4);
  39. wynik2 = wynik % ilor;
  40.  
  41.  
  42. ////{
  43. //// if ((a*b*c*k) % d == 1)
  44. ////break;
  45. /////
  46. //////}
  47.  
  48. cout << "wynik to : " << wynik2<< endl;
  49.  
  50. Sleep(10000);
  51. return 0;
  52. cin.get();
  53. cin.get();
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement