Advertisement
Spocoman

Cat Diet

Dec 12th, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CatDiet
  4. {
  5.     class Program
  6.     {
  7.         public static void Main()
  8.         {
  9.             int fats = int.Parse(Console.ReadLine());
  10.             int proteins = int.Parse(Console.ReadLine());
  11.             int carbohydrates = int.Parse(Console.ReadLine());
  12.             double calories = int.Parse(Console.ReadLine());
  13.             int water = int.Parse(Console.ReadLine());
  14.  
  15.             double caloriesPerGram = (100 - water) * (calories / (calories * fats / 9
  16.                 + calories * proteins / 4 + calories * carbohydrates / 4));
  17.             Console.WriteLine($"{caloriesPerGram:f4}");
  18.         }
  19.     }
  20. }
  21.  
  22.        
  23.    
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement