Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fonction convert:
- paramètres
- in entier n
- in entier base := 2
- out chaîne
- début
- entier q, r
- q := div_eucl(n, base)
- r := n % base
- chaîne reste
- reste := entier_vers_chaîne(r)
- si q = 0
- retourner reste
- fin si
- retourner concat(convert(q, base), reste)
- fin
- fin fonction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement