Advertisement
Spocoman

Gifts from Santa

Oct 10th, 2024
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.32 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var n, m, s int
  7.     fmt.Scanln(&n)
  8.     fmt.Scanln(&m)
  9.     fmt.Scanln(&s)
  10.    
  11.     for i := m; i >= n; i-- {
  12.         if i == s && s % 2 == 0 && s % 3 == 0 {
  13.             break
  14.         } else if i % 2 == 0 && i % 3 == 0 {
  15.             fmt.Printf("%d ", i)
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement