Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var fats, proteins, carbohydrates, calories, water float64
- fmt.Scanln(&fats)
- fmt.Scanln(&proteins)
- fmt.Scanln(&carbohydrates)
- fmt.Scanln(&calories)
- fmt.Scanln(&water)
- caloriesPerGram := (100 - water) * (calories / (calories * fats / 9 + calories * proteins / 4 + calories * carbohydrates / 4))
- fmt.Printf("%.4f\n", caloriesPerGram)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement