SHARE
TWEET

Untitled

a guest Jun 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2. import (
  3.   "fmt"
  4. )
  5.  
  6. func ints(n int) ([]int) {
  7.   xs := make([]int, n)
  8.   for i := range xs {
  9.     fmt.Scan(&xs[i])
  10.   }
  11.   return xs
  12. }
  13.  
  14. func main() {
  15.   xs := ints(3)
  16.   for _, x := range xs {
  17.     fmt.Printf("Hi %d\n", x)
  18.   }
  19. }
RAW Paste Data
Top