You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.9 KiB

## revive_three_nums
## **WARNING! VERY IMPORTANT!**
For this exercise a function will be tested **with the exam own main**. However the student **still needs** to submit a structured program:
This means that:
- The package needs to be named `package main`.
5 years ago
- The submitted code needs one declared function main(`func main()`) even if empty.
- The function main declared needs to **also pass** the `Restrictions Checker`(illegal functions tester). It is advised for the student to just empty the function main after its own testings are done.
- Every other rules are obviously the same than for a `program`.
### Instructions
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
There are basically three integers: **a**, **b**, **c**. You are given 4 integers: **b+c**, **a+b**, **c+a**, **a+b+c** (not necessarily in this order). Return maximum of a, b, c.
### Expected function
```go
func Revive_three_nums(a, b, c, d int) int {
}
```
### Usage
Here is a possible program to test your function :
```go
package main
import (
"fmt"
)
func main() {
fmt.Println(Revive_three_nums(3, 6, 5, 4))
fmt.Println(Revive_three_nums(40, 40, 40, 60))
fmt.Println(Revive_three_nums(201, 101, 101, 200))
}
```
And its output :
```console
student@ubuntu:~/[[ROOT]]/test$ go build
student@ubuntu:~/[[ROOT]]/test$ ./test
3
20
100
student@ubuntu:~/[[ROOT]]/test$
```