package main import "fmt" func main() { var age int fmt.Printf("Enter your age on Earth: ") _, err := fmt.Scanf("%d", &age) if (err != nil) { fmt.Println(err) } age = age * 365 / 687 fmt.Printf("Your age on the surface of Mars is %d years old.\n", age) }
- package main
- import "fmt"
- func main() {
age := 28 * 365 / 687fmt.Printf("My age on the surface of Mars is %d years old.", age)- var age int
- fmt.Printf("Enter your age on Earth: ")
- _, err := fmt.Scanf("%d", &age)
- if (err != nil) {
- fmt.Println(err)
- }
- age = age * 365 / 687
- fmt.Printf("Your age on the surface of Mars is %d years old.
- ", age)
- }