forked from root/public
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.
43 lines
894 B
43 lines
894 B
5 years ago
|
# printcomb
|
||
|
|
||
|
## Instructions
|
||
|
|
||
|
Write a [function](TODO-LINK) that prints in ascending order on a single line all unique combinations of three different digits so that the first digit is less than the second and the second is less than the third.
|
||
|
|
||
|
These combinations are separated by a comma and a space.
|
||
|
|
||
|
## Expected function
|
||
|
|
||
|
```go
|
||
|
func PrintComb() {
|
||
|
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
Here is a possible [program](TODO-LINK) to test your function :
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
|
import piscine ".."
|
||
|
|
||
|
func main() {
|
||
|
piscine.PrintComb()
|
||
|
}
|
||
|
```
|
||
|
|
||
|
This is the incomplete output :
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/piscine/test$ go build
|
||
|
student@ubuntu:~/piscine/test$ ./test
|
||
|
012, 013, 014, 015, 016, 017, 018, 019, 023, ..., 689, 789
|
||
|
student@ubuntu:~/piscine/test$
|
||
|
```
|
||
|
|
||
|
`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.
|