Sim0o0na

01. Cat Diet

Jun 18th, 2018
1,835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Practice
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double fats = int.Parse(Console.ReadLine());
  14.             double proteins = int.Parse(Console.ReadLine());
  15.             double carbs = int.Parse(Console.ReadLine());
  16.             double calories = int.Parse(Console.ReadLine());
  17.             double water = int.Parse(Console.ReadLine());
  18.  
  19.             double fatsGR = ((fats/100)*2500)/ 9;
  20.             double proteinGR = ((proteins / 100) * 2500) / 4;
  21.             double carbGR = ((carbs / 100) * 2500) / 4;
  22.  
  23.             double weight = fatsGR + proteinGR + carbGR;
  24.             double weightPerGr = 2500 / weight;
  25.  
  26.             double oneGR = weightPerGr * (1 - water / 100);
  27.             Console.WriteLine($"{oneGR:F4}");
  28.  
  29.  
  30.         }
  31.     }
  32. }
Add Comment
Please, Sign In to add comment