摘要:
package main import ( "fmt" "io/ioutil" "time" "unsafe" sdl "github.com/moonfdd/sdl2-go/sdl2" "github.com/moonfdd/sdl2-go/sdlcommon" ) const REFRESH_E 阅读全文
摘要:
package main import ( "fmt" "runtime" ) func main() { fmt.Println("You are running on:") switch runtime.GOOS { case "windows": fmt.Println("Windows") 阅读全文
摘要:
#ifdef _WINDOWS_ CreateThread(); //windows下线程的创建 #else Pthread_create(); //Linux下线程的创建 #endif https://zhuanlan.zhihu.com/p/627322587 阅读全文
摘要:
package main import "fmt" func main() { //阶乘 jiecheng := 1 for i := 1; i < 10; i++ { jiecheng *= i fmt.Printf("%d的阶乘是%d\n", i, jiecheng) } } package m 阅读全文
摘要:
package main import "fmt" func main() { for i := 0; i < 9; i++ { for j := 0; j < 9; j++ { fmt.Printf("%d x %d =%d\t", i, j, i*j) } } } 阅读全文
摘要:
package main import ( "fmt" ) func main() { var b float64 var a float64 = 42 b = a * a fmt.Println("结果", b) } package main import ( "fmt" "math" ) fun 阅读全文
摘要:
package main import ( "fmt" ) func divide(a, b int) (int, error) { if b == 0 { return 0, fmt.Errorf("不能除以0") } return a / b, nil } func main() { resul 阅读全文