Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math/rand"
- "time"
- )
- func random(min, max int) int {
- rand.Seed(time.Now().UnixNano())
- return rand.Intn(max-min) + min
- }
- func main() {
- for {
- a := float32(random(1, 9))
- b := float32(random(1, 9))
- c := float32(random(1, 9))
- d := float32(random(1, 9))
- e := float32(random(1, 9))
- f := float32(random(1, 9))
- g := float32(random(1, 9))
- h := float32(random(1, 9))
- i := float32(random(1, 9))
- result := float32(a + (13 * b / c) + d + (12 * e) - f - 11 + (g * h / i) - 10)
- if result == float32(66.00000000000000000) {
- fmt.Printf("%.0f + (13 * %.0f / %.0f) + %.0f + (12 * %.0f) - %.0f - 11 + (%.0f * %.0f / %.0f) - 10", a, b, c, d, e, f, g, h, i)
- fmt.Println()
- return
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement