1
0
forked from kalmar/DALGLI0

jar built

This commit is contained in:
Hubert Tylkowski 2018-06-25 19:23:22 +02:00
parent 59a44d5026
commit 2354df2ae0
3 changed files with 5 additions and 3 deletions

View File

@ -8,9 +8,11 @@ public class Main {
//ex input in run console : 2 "1 1 1 0 1" "0 1 1"
int n = Integer.parseInt(args[0]);
List<Integer> firstPolynomial = new ArrayList<>();
Arrays.asList(args[1].split("\\s* \\s*")).forEach(factor -> firstPolynomial.add(Integer.valueOf(factor)));
args[1] = args[1].substring(1, args[1].length()-1);
args[2] = args[2].substring(1, args[2].length()-1);
Arrays.asList(args[1].split( ",\\s*" )).forEach(factor -> firstPolynomial.add(Integer.valueOf(factor)));
List<Integer> secondPolynomial = new ArrayList<>();
Arrays.asList(args[2].split("\\s* \\s*")).forEach(factor -> secondPolynomial.add(Integer.valueOf(factor)));
Arrays.asList(args[2].split(",\\s*" )).forEach(factor -> secondPolynomial.add(Integer.valueOf(factor)));
PolynomialTask polynomialTask = new PolynomialTask(n, firstPolynomial, secondPolynomial);
polynomialTask.printAllValuesToStandardOutput();
}

View File

@ -162,7 +162,7 @@ class CrcTask {
}
private String letterToBinaryString(char letter) {
int a = (int) letter;
short a = (short) letter;
StringBuilder binaryString = new StringBuilder(Integer.toBinaryString(a));
while (binaryString.length() % 8 != 0) {
binaryString.insert(0, "0");