Advertisement
Spocoman

04. Car Number

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