Dmitry Telenkov 6 日 前
コミット
c441c3bb46
1 ファイル変更11 行追加1 行削除
  1. 11 1
      go/codewars/task1.go

+ 11 - 1
go/codewars/task1.go

@@ -32,8 +32,18 @@ func SmallestIntegerFinder(numbers []int) (min int) {
 	return // your code here
 }
 
+func Litres(time float64) int {
+	return int(time) / 2
+}
+
+func CreatePhoneNumber(numbers [10]int) string {
+	return fmt.Sprintf("(%d%d%d) %d%d%d-%d%d%d%d", numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], numbers[6], numbers[7], numbers[8], numbers[9])
+}
+
 func main() {
 	fmt.Println("Testing...")
 	//fmt.Println(SquareSum([]int{1, 2, 5, 6}))
-	fmt.Println(Solution("world"))
+	// fmt.Println(Solution("world"))
+	// fmt.Println(Litres(6.7))
+	fmt.Println(CreatePhoneNumber([10]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}))
 }