|
|
@ -2,11 +2,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
Write a function that returns the the value in the middle of 5 five arguments. |
|
|
|
Écrire une fonction qui retournes la médiane de 5 arguments. |
|
|
|
|
|
|
|
|
|
|
|
This function must have the following signature. |
|
|
|
### Fonction attendue |
|
|
|
|
|
|
|
|
|
|
|
### Expected function |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```go |
|
|
|
```go |
|
|
|
func Abort(a, b, c, d, e int) int { |
|
|
|
func Abort(a, b, c, d, e int) int { |
|
|
@ -14,29 +12,29 @@ func Abort(a, b, c, d, e int) int { |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
### Usage |
|
|
|
### Utilisation |
|
|
|
|
|
|
|
|
|
|
|
Here is a possible [program](TODO-LINK) to test your function : |
|
|
|
Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : |
|
|
|
|
|
|
|
|
|
|
|
```go |
|
|
|
```go |
|
|
|
package main |
|
|
|
package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
student ".." |
|
|
|
piscine ".." |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
middle := student.Abort(2, 3, 8, 5, 7) |
|
|
|
middle := piscine.Abort(2, 3, 8, 5, 7) |
|
|
|
fmt.Println(middle) |
|
|
|
fmt.Println(middle) |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
And its output : |
|
|
|
Et son résultat : |
|
|
|
|
|
|
|
|
|
|
|
```console |
|
|
|
```console |
|
|
|
student@ubuntu:~/student/abort$ go build |
|
|
|
student@ubuntu:~/piscine/test$ go build |
|
|
|
student@ubuntu:~/student/abort$ ./abort |
|
|
|
student@ubuntu:~/piscine/test$ ./test |
|
|
|
5 |
|
|
|
5 |
|
|
|
student@ubuntu:~/student/abort$ |
|
|
|
student@ubuntu:~/piscine/test$ |
|
|
|
``` |
|
|
|
``` |
|
|
|