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 = [
- -5,
- 3,
- -5,
- ];
- const gets = this.gets || getGets(test);
- const print = this.print || console.log;
- let x = +gets();
- let y = +gets();
- let z = +gets();
- let maxNum = 0;
- let midNum = 0;
- let minNum = 0;
- if(x > y && x> z)
- {
- maxNum= x;
- if(y>z)
- {
- midNum= y;
- minNum = z;
- }
- else if(y<z)
- {
- midNum = z;
- minNum = y;
- }
- }
- if(y > x && y>z)
- {
- maxNum= y;
- if(x>z)
- {
- midNum=x;
- minNum=z;
- }
- else if(x<z)
- {
- midNum=z;
- minNum=x;
- }
- }
- if(z>y && z>x)
- {
- maxNum=z;
- if(y>x)
- {
- midNum=y;
- minNum=x;
- }
- else if(y<x)
- {
- midNum=x;
- minNum=y;
- }
- }
- print(maxNum, midNum, minNum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement