package main
import "fmt"
func main() {
r1, r2, r3, r4 := Calculate1(10, 4)
fmt.Println("r1:", r1)
fmt.Println("r2:", r2)
fmt.Println("r3:", r3)
fmt.Println("r4:", r4)
re1, re2, re3, re4 := Calculate2(10, 4)
fmt.Println("re1:", re1)
fmt.Println("re2:", re2)
fmt.Println("re3:", re3)
fmt.Println("re4:", re4)
}
func Calculate1(a, b int) (int, int, int, float32) {
result1 := a + b
result2 := a - b
result3 := a * b
result4 := float32(a) / float32(b)
return result1, result2, result3, result4
}
func Calculate2(a, b int) (result1 int, result2 int, result3 int, result4 float32) {
result1 = a + b
result2 = a - b
result3 = a * b
result4 = float32(a) / float32(b)
return
}
r1: 14
r2: 6
r3: 40
r4: 2.5
re1: 14
re2: 6
re3: 40
re4: 2.5