Skip to content

Instantly share code, notes, and snippets.

@rondDev
Created August 17, 2021 06:42
Show Gist options
  • Select an option

  • Save rondDev/7cbe73be1e9b187480e42b0e9700c3e4 to your computer and use it in GitHub Desktop.

Select an option

Save rondDev/7cbe73be1e9b187480e42b0e9700c3e4 to your computer and use it in GitHub Desktop.
Calculate your age on mars (:
package main
import "fmt"
func main() {
var age int
fmt.Scanln(&age)
mars := mars_age(age)
fmt.Println(mars)
}
func mars_age(age int) int {
i := float32(age)
x := float32(365)
y := float32(687)
z := x / y
i = i * z
return int(i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment