GoLang
xxxxxxxxxx
package main
import (
"fmt"
"os"
)
type point struct {
x, y int
}
func main() {
p := point{1, 2}
fmt.Printf("%v\n", p)
fmt.Printf("%+v\n", p)
fmt.Printf("%#v\n", p)
fmt.Printf("%T\n", p)
fmt.Printf("%t\n", true)
fmt.Printf("%d\n", 123)
fmt.Printf("%b\n", 14)
fmt.Printf("%c\n", 33)
fmt.Printf("%x\n", 456)
fmt.Printf("%f\n", 78.9)
fmt.Printf("%e\n", 123400000.0)
fmt.Printf("%E\n", 123400000.0)
fmt.Printf("%s\n", "\"string\"")
fmt.Printf("%q\n", "\"string\"")
fmt.Printf("%x\n", "hex this")
fmt.Printf("%p\n", &p)
fmt.Printf("|%6d|%6d|\n", 12, 345)
fmt.Printf("|%6.2f|%6.2f|\n", 1.2, 3.45)
fmt.Printf("|%-6.2f|%-6.2f|\n", 1.2, 3.45)
fmt.Printf("|%6s|%6s|\n", "foo", "b")
fmt.Printf("|%-6s|%-6s|\n", "foo", "b")
s := fmt.Sprintf("a %s", "string")
fmt.Println(s)
fmt.Fprintf(os.Stderr, "an %s\n", "error")
}
{1 2} {x:1 y:2} main.point{x:1, y:2} main.point true 123 1110 ! 1c8 78.900000 1.234000e+08 1.234000E+08 "string" "\"string\"" 6865782074686973 0x42135100 | 12| 345| | 1.20| 3.45| |1.20 |3.45 | | foo| b| |foo |b | a string an error
Linux - Comment installer anc-api-tools
Linux - Comment installer curvedns
Python - Vérifier si un nombre est positif, négatif ou 0
Linux - Comment installer zenmap
C - Compter le nombre de chiffres dans un entier
C++ - Vérifier l'année bissextile
JavaScript - Vérifier si une chaîne commence et se termine par certains caractères
C++ - Vérifier si un nombre est premier ou non
C - Trouver le plus grand nombre à l'aide de l'allocation de mémoire dynamique
Kotlin - Arrondir un nombre à n décimales
Kotlin - Inverser un nombre
Linux - Comment installer xbitmaps
Linux - Comment installer zstd
Java - Inverser un nombre
Linux - Comment installer zfs-test
Python - Écriture de fichiers Excel (XLSX)
C++ - Trouver le quotient et le reste
Linux - Comment installer zookeeper-bin
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month