123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- package main
- import (
- "fmt"
- "math/rand"
- )
- const MaxRand = 16
- func StatRandomNumbers(numRands int) (int, int) {
-
- var a, b int
-
- for i := 0; i < numRands; i++ {
-
- if rand.Intn(MaxRand) < MaxRand/2 {
- a = a + 1
- } else {
- b++
- }
- }
- return a, b
- }
- func SquareesofSumAndDiff(a, b int64) (s, d int64) {
-
- s = (a + b) * (a + b)
- d = (a - b) * (a - b)
- return
- }
- func main() {
- {
-
-
-
-
-
-
-
-
-
- }
- {
-
-
-
- }
- {
-
-
-
-
-
-
-
-
-
-
-
-
- }
- {
- x, y := "炸", "煎鱼"
- fmt.Println(&x)
- _, _ = func(x, y string) (s string, err error) {
- x = "吃"
- fmt.Println(&x)
- return x + y, nil
- }(x, y)
- fmt.Println(&x)
- fmt.Println(x, y)
- }
- }
|