Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- string name = Console.ReadLine();
- decimal volume = decimal.Parse(Console.ReadLine()); //
- decimal energy = decimal.Parse(Console.ReadLine())/100m; // energy /ml
- decimal sugar = decimal.Parse(Console.ReadLine())/100m; //
- decimal energyTotal = volume*energy;
- decimal sugarTotal = volume*sugar;
- Console.WriteLine("{0}ml {1}:\n{2:f1}kcal, {3:f1}g sugars", volume, name, energyTotal, sugarTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement