Advertisement
Spocoman

04. Special Numbers

Sep 24th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.46 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var n  int
  7.     fmt.Scanln(&n)
  8.  
  9.     for n1 := 1; n1 <= 9; n1++ {
  10.         for n2 := 1; n2 <= 9; n2++ {
  11.             for n3 := 1; n3 <= 9; n3++ {
  12.                 for n4 := 1; n4 <= 9; n4++ {
  13.                     if n % n1 == 0 && n % n2 == 0 && n % n3 == 0 && n % n4 == 0 {
  14.                         fmt.Printf("%d%d%d%d ", n1, n2, n3, n4)
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement