Advertisement
Spocoman

02. Letters Combinations

Sep 25th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.54 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var a, b, c string
  7.     fmt.Scanln(&a)
  8.     fmt.Scanln(&b)
  9.     fmt.Scanln(&c)
  10.  
  11.     x := int(rune(a[0]))
  12.     y := int(rune(b[0]))
  13.     z := int(rune(c[0]))
  14.    
  15.     var counter = 0
  16.  
  17.     for i := x; i <= y; i++ {
  18.         for k := x; k <= y; k++ {
  19.             for j := x; j <= y; j++ {
  20.                 if i != z && k != z && j != z {
  21.                     fmt.Printf("%c%c%c ", i, k, j)
  22.                     counter++
  23.                 }
  24.             }
  25.         }
  26.     }
  27.     fmt.Println(counter)
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement