Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var firstName, lastName string
- fmt.Scanln(&firstName)
- fmt.Scanln(&lastName)
- var age int
- fmt.Scanln(&age)
- var town string
- fmt.Scanln(&town)
- fmt.Printf("You are %s %s, a %d-years old person from %s.", firstName, lastName, age, town)
- }
- ИЛИ:
- package main
- import "fmt"
- func main() {
- var firstName, lastName,age, town string
- fmt.Scanln(&firstName)
- fmt.Scanln(&lastName)
- fmt.Scanln(&age)
- fmt.Scanln(&town)
- fmt.Println("You are " + firstName + " " + lastName + ", a " + age + "-years old person from " + town + ".")
- // fmt.Print("You are ", firstName, " ", lastName, ", a ", age, "-years old person from ", town, ".\n")
- // fmt.Printf("You are %s %s, a %s-years old person from %s.", firstName, lastName, age, town)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement