Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = [
- '2', // the input is always a string, so it's '3' and not 3
- '5',
- '-3'
- ];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- let a = +gets();
- let b = +gets();
- let c = +gets();
- let D = Math.pow(b, 2) - 4 * a * c;
- let x1 = (- b - Math.sqrt(D)) / (2 * a);
- let x2 = (- b + Math.sqrt(D)) / (2 * a);
- print(x1);
- print(x2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement