Advertisement
Spocoman

Cat Diet

Oct 3rd, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.42 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var fats, proteins, carbohydrates, calories, water float64
  7.     fmt.Scanln(&fats)
  8.     fmt.Scanln(&proteins)
  9.     fmt.Scanln(&carbohydrates)
  10.     fmt.Scanln(&calories)
  11.     fmt.Scanln(&water)
  12.  
  13.     caloriesPerGram := (100 - water) * (calories / (calories * fats / 9 + calories * proteins / 4 + calories * carbohydrates / 4))
  14.  
  15.     fmt.Printf("%.4f\n", caloriesPerGram)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement