Browse Source

subjects update

content-update
Christopher Fremond 5 years ago committed by Christopher Fremond
parent
commit
98f811b0be
  1. 4
      subjects/printbits.en.md
  2. 31
      subjects/printbits.fr.md

4
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$
```
```

31
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".

Loading…
Cancel
Save