Advertisement
Ruslan-7E

3 digit number

May 23rd, 2022
555
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var n int
  7.     fmt.Scan(&n)
  8.  
  9.     var a int = n / 100
  10.     var b int = n / 10
  11.     var c int = n % 10
  12.  
  13.     if a != b && b != c && c != a {
  14.         fmt.Println("YES")
  15.     } else if a == b || b == c || c == a {
  16.         fmt.Println("NO")
  17.     }
  18. }
  19.  
Advertisement
RAW Paste Data Copied
Advertisement