diff --git a/subjects/printcombprog.en.md b/subjects/printcombprog.en.md new file mode 100644 index 000000000..c10cb2034 --- /dev/null +++ b/subjects/printcombprog.en.md @@ -0,0 +1,22 @@ +## printcombprog + +### Instructions + +Write a program that prints in ascending order on a single line all unique combinations of three different digits so that the first digit is lower than the second and the second is lower than the third. + +These combinations are separated by a comma and a space. + +### Usage + +Here is an **incomplete** output : + +```console +student@ubuntu:~/piscine-go/printcombprog$ go build +student@ubuntu:~/piscine-go/printcombprog$ ./printcombprog | cat -e +012, 013, 014, 015, 016, 017, 018, 019, 023, ..., 689, 789$ +student@ubuntu:~/piscine-go/printcombprog$ +``` + +`000` or `999` are not valid combinations because the digits are not different. + +`987` should not be shown because the first digit is not less than the second. diff --git a/subjects/printcombprog.fr.md b/subjects/printcombprog.fr.md new file mode 100644 index 000000000..f25257321 --- /dev/null +++ b/subjects/printcombprog.fr.md @@ -0,0 +1,22 @@ +## printcombprog + +### Instructions + +Écrire un programme qui affiche sur une seule ligne dans l'ordre croissant toutes les combinaisons possibles de trois chiffres différents tels que le premier est inférieur au second et le second est inférieur au troisième. + +Les combinaisons sont séparées par une virgule et un espace. + +### Utilisation + +Voici une sortie **tronquée** : + +```console +student@ubuntu:~/piscine-go/printcombprog$ go build +student@ubuntu:~/piscine-go/printcombprog$ ./printcombprog | cat -e +012, 013, 014, 015, 016, 017, 018, 019, 023, ..., 689, 789$ +student@ubuntu:~/piscine-go/printcombprog$ +``` + +`000` et `999` ne sont pas des combinations valides parce que les chiffres ne sont pas différents. + +`987` ne doit pas être affiché parce que le premier chiffre n'est pas inférieur au second.