diff --git a/Main.java b/Main.java index faeb546..62a28a9 100644 --- a/Main.java +++ b/Main.java @@ -53,4 +53,38 @@ public class Main { public static void showPoly(LinkedList poly) { System.out.println(poly.toString()); } + + + public static int multiplier(int number, int expect, int mod) { + + /* + if(nwd(number,mod) != 1 || nwd(number,mod) != number) { + System.out.println("NIE DA SIE"); + return 0; + }*/ + + for(int i=1;i modPolynomial(int mod, LinkedList polynomial){ + + LinkedList result = new LinkedList(); + + while(!polynomial.isEmpty()) { + + if(polynomial.peek() < 0) { + + result.add(mod + polynomial.poll()); + } + else result.add(polynomial.poll() % mod); + } + return result; + } + } \ No newline at end of file