zad 02,03 #37

Closed
s426159 wants to merge 14 commits from s426159/DALGLI0:master into master
Showing only changes of commit 8a28a2cfb1 - Show all commits

View File

@ -1,18 +1,10 @@
let Polynomial = require('./polynomial.js');
let mul, div, gcd;
function parseArray(x) {
let stringResult = "";
result = Array.from(x).filter(x => {
if (x == ' ' || x == '[' || x == ']') return false;
else return true;
}).join('').split(',').map(x => parseInt(x));
return result;
}
let n = parseInt(process.argv[2]);
let p1 = parseArray(process.argv[3]);
let p2 = parseArray(process.argv[4]);
let p1 = JSON.parse(process.argv[3].replace(/'/g, '"'));
let p2 = JSON.parse(process.argv[4].replace(/'/g, '"'));
let f = new Polynomial.Class(n, p1);
let g = new Polynomial.Class(n, p2);