From 98f811b0beb5924ed3e85d11a6032d64caee0682 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 05:14:11 +0100 Subject: [PATCH] subjects update --- subjects/printbits.en.md | 4 ++-- subjects/printbits.fr.md | 31 +++++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/subjects/printbits.en.md b/subjects/printbits.en.md index dc9400e35..259e21861 100644 --- a/subjects/printbits.en.md +++ b/subjects/printbits.en.md @@ -4,7 +4,7 @@ Write a program that takes a number as argument, and prints it in binary value **without a newline at the end**. -- If the the argument isn't a number it should print `00000000`. +- If the the argument is not a number the program should print `00000000`. ### Expected output : @@ -19,4 +19,4 @@ student@ubuntu:~/printbits$ ./printbits a student@ubuntu:~/printbits$ ./printbits 1 1 student@ubuntu:~/printbits$ ./printbits student@ubuntu:~/printbits$ -``` \ No newline at end of file +``` diff --git a/subjects/printbits.fr.md b/subjects/printbits.fr.md index 8e546ddd0..724a1c24f 100644 --- a/subjects/printbits.fr.md +++ b/subjects/printbits.fr.md @@ -2,18 +2,21 @@ ### Instructions -Écrire une fonction qui prend un `byte`, et qui l'affiche en valeur binaire **sans newline à la fin**. - -### Fonction attendue - -```go -func PrintBits(octe byte) { - -} +Écrire un programme qui prend un nombre en argument, et qui l'affiche en valeur binaire **sans newline à la fin**. + +- Si l'argument n'est pas un nombre le programme doit afficher `00000000`. + +### Expected output : + +```console +student@ubuntu:~/printbits$ go build +student@ubuntu:~/printbits$ ./printbits 1 +00000001student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 192 +11000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits a +00000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 1 1 +student@ubuntu:~/printbits$ ./printbits +student@ubuntu:~/printbits$ ``` - -### Usage - -Exemple d'output: - -Si 2 est passé à la fonction `PrintBits`, elle affichera "00000010".