-
Notifications
You must be signed in to change notification settings - Fork 4
/
087-stats-training-js-2.js
47 lines (38 loc) · 1.11 KB
/
087-stats-training-js-2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// In javascript, Number is one of basic data types. It can be positive:
// 1,2,3, negative:-1,-100 , integer:123,456, decimal:3.1415926,-8.88 etc..
// Numbers can use operators such as + - * / %
// I've written five function ```equal1,equal2,equal3,equal4,equal5```,
// defines six global variables ```v1 v2 v3 v4 v5 v6```, every function has
// two local variables ```a,b```, please set the appropriate value for the two
// variables(select from v1--v6), making these function return value equal to
// 100. the function equal1 is completed, please refer to this example to
// complete the following functions.
// When you have finished the work, click "Run Tests" to see if your code is
// working properly.
// In the end, click "Submit" to submit your code pass this kata.
var v1=50,v2=100,v3=150,v4=200,v5=2,v6=250
function equal1(){
var a=v1
var b=v1
return a+b;
}
function equal2(){
var a= v4;
var b= v2;
return a-b;
}
function equal3(){
var a= v5;
var b= v1;
return a*b;
}
function equal4(){
var a= v4;
var b= v5;
return a/b;
}
function equal5(){
var a= v6;
var b= v3;
return a%b;
}