Created
August 17, 2021 06:42
-
-
Save rondDev/7cbe73be1e9b187480e42b0e9700c3e4 to your computer and use it in GitHub Desktop.
Calculate your age on mars (:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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