umfangreicheres Beispiel
This commit is contained in:
BIN
hello/hello
Executable file
BIN
hello/hello
Executable file
Binary file not shown.
@@ -7,5 +7,20 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
var name string
|
||||||
|
var age int
|
||||||
|
fmt.Print("Bitte gibt Dein Alter ein: ")
|
||||||
|
fmt.Scan(&age)
|
||||||
|
if age < 18 {
|
||||||
|
fmt.Println("Du bist nicht volljährig")
|
||||||
|
fmt.Printf("Du brauchst noch %v Jahre", 18-age)
|
||||||
|
fmt.Println("")
|
||||||
|
} else {
|
||||||
|
fmt.Println("ok")
|
||||||
|
}
|
||||||
|
fmt.Print("Bitte gib Deinen Namen ein: ")
|
||||||
|
fmt.Scan(&name)
|
||||||
|
fmt.Println("Hallo " + name)
|
||||||
|
fmt.Printf("Du bist %v Jahre alt", age)
|
||||||
fmt.Println(quote.Go())
|
fmt.Println(quote.Go())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user