Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strconv"
- )
- func main() {
- var n, counter int
- fmt.Scanln(&n)
- var print = "No!"
- for a := 1; a <= 9; a++ {
- for b := 1; b <= 9; b++ {
- for c := 1; c <= 9; c++ {
- for d := 1; d <= 9; d++ {
- if a * b + c * d == n && a < b && c > d {
- fmt.Printf("%d%d%d%d ", a, b, c, d)
- counter++
- if counter == 4 {
- print = "Password: " + strconv.Itoa(a) + strconv.Itoa(b) + strconv.Itoa(c) + strconv.Itoa(d)
- }
- }
- }
- }
- }
- }
- fmt.Printf("\n%s", print)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement