Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getGets = (arr) => {
- let index = 0;
- return () => {
- const toReturn = arr[index];
- index += 1;
- return toReturn;
- };
- };
- // this is the test
- const test = ['-1', '3', '0'];
- const gets = this.gets || getGets(test);
- const print = this.print || console.log;
- let a = +gets();
- let b = +gets();
- let c = +gets();
- const x1 = (-b + Math.sqrt(b ** 2 - 4 * a * c)) / (2 * a);
- const x2 = (-b - Math.sqrt(b ** 2 - 4 * a * c)) / (2 * a);
- console.log(x1);
- console.log(x2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement