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.
 
 
 
 

735 B

convertbase

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.

Fonction attendue

func ConvertBase(nbr, baseFrom, baseTo string) string {

}

Utilisation

Voici un éventuel programme pour tester votre fonction :

package main

import (
	"fmt"
	piscine ".."
)

func main() {
	result := piscine.ConvertBase("101011", "01", "0123456789")
	fmt.Println(result)
}

Et son résultat :

student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test
43
student@ubuntu:~/piscine-go/test$