diff --git a/hello/hello b/hello/hello new file mode 100755 index 0000000..cc74ae1 Binary files /dev/null and b/hello/hello differ diff --git a/hello/hello.go b/hello/hello.go index f34311c..8d0d25c 100644 --- a/hello/hello.go +++ b/hello/hello.go @@ -7,5 +7,20 @@ import ( ) 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()) }