Skip to content

Instantly share code, notes, and snippets.

@in1yan
Created February 19, 2025 03:19
Show Gist options
  • Save in1yan/f1d94d41700db7673615668c9f694b4c to your computer and use it in GitHub Desktop.
Save in1yan/f1d94d41700db7673615668c9f694b4c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main(){
format_phone_number([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0})
format_phone_number([]int{5, 1, 9, 5, 5, 5, 4, 4, 6, 8})
format_phone_number([]int{3, 4, 5, 5, 0, 1, 2, 5, 2, 7})
}
func format_phone_number(numbers []int){
fmt.Printf("(%d%d%d) %d%d%d-%d%d%d%d\n", numbers[0],numbers[1],numbers[2],numbers[3],numbers[4],numbers[5],numbers[6],numbers[7],numbers[8], numbers[9])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment