Created
June 29, 2020 12:22
-
-
Save jdmedeiros/db208853b9256b16895895a449b04315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
"sort" | |
) | |
func main() { | |
rand.Seed(time.Now().UnixNano()) | |
var numeros [5]int | |
var estrelas [2]int | |
i := 0 | |
p := rand.Perm(51) | |
for _, r := range p[:5] { | |
numeros[i] = r + 1 | |
i++ | |
} | |
i = 0 | |
p = rand.Perm(12) | |
for _, r := range p[:2] { | |
estrelas[i] = r + 1 | |
i++ | |
} | |
sort.Ints(numeros[:]) | |
sort.Ints(estrelas[:]) | |
fmt.Print(numeros) | |
fmt.Print(" - ") | |
fmt.Println(estrelas) | |
fmt.Println("Boa sorte!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment