1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| package main
import "fmt"
func main(){
str:="jonson"
fmt.Printf("%T,%v\n",str,str)
var booeanl = true fmt.Printf("%T,%t\n",booeanl,booeanl)
fmt.Printf("%%\n") fmt.Printf("\"\n") fmt.Printf("\\\n")
fmt.Printf("%T,%d\n",123,123) fmt.Printf("%T,%6d\n",123,123) fmt.Printf("%T,%06d\n",123,123) fmt.Printf("%T,%b\n",123,123) fmt.Printf("%T,%o\n",123,123) fmt.Printf("%T,%x\n",123,123) fmt.Printf("%T,%#x\n",123,123) fmt.Printf("%T,%#o\n",123,123)
fmt.Printf("%T,%#X\n",123,123)
fmt.Printf("% d,% d\n",123,-123)
fmt.Printf("%T,%f\n",123.456,123.456) fmt.Printf("%T,%10f\n",123.456,123.456) fmt.Printf("%T,%.1f\n",123.456,123.456) fmt.Printf("%T,%10.2f\n",123.456,123.456)
fmt.Printf("%T,%s\n","jonson","jonson")
fmt.Printf("%T,%c\n",'c',97) }
|