Advertisement
Spocoman

Letters Combinations

Oct 10th, 2024
32
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 x, y, z string
  7.     fmt.Scanln(&x)
  8.     fmt.Scanln(&y)
  9.     fmt.Scanln(&z)
  10.    
  11.     counter := 0
  12.  
  13.     for i := int(x[0]); i <= int(y[0]); i++ {
  14.         for k := int(x[0]); k <= int(y[0]); k++ {
  15.             for j := int(x[0]); j <= int(y[0]); j++ {
  16.                 if i != int(z[0]) && k != int(z[0]) && j != int(z[0]) {
  17.                     fmt.Printf("%c%c%c ", i, k, j)
  18.                     counter++
  19.                 }
  20.             }
  21.         }
  22.     }
  23.  
  24.     fmt.Println(counter)
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement