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.

45 lines
729 B

5 years ago
## convertbase
5 years ago
### Instructions
Écrire une fonction qui retourne la convertion d'un nombre `string` d'une baseFrom `string` à une baseTo `string`.
Seules des bases valides seront testées.
Les nombres négatifs ne seront pas testés.
5 years ago
### Fonction attendue
```go
func ConvertBase(nbr, baseFrom, baseTo string) string {
5 years ago
}
```
5 years ago
### Utilisation
Voici un éventuel [programme](TODO-LINK) pour tester votre fonction :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
result := piscine.ConvertBase("101011", "01", "0123456789")
fmt.Println(result)
}
```
Et son résultat :
```console
student@ubuntu:~/[[ROOT]]/test$ go build
student@ubuntu:~/[[ROOT]]/test$ ./test
43
student@ubuntu:~/[[ROOT]]/test$
```