Advertisement
Spocoman

05. Challenge the Wedding

Sep 25th, 2024
57
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 men, women, tables int
  7.     fmt.Scanln(&men)
  8.     fmt.Scanln(&women)
  9.     fmt.Scanln(&tables)
  10.  
  11.     for i := 1; i <= men; i++ {
  12.         for k := 1; k <= women && tables != 0; k++ {
  13.             fmt.Printf("(%d <-> %d) ", i, k)
  14.             tables--
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement