Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp8
- {
- class Program
- {
- static void Main(string[] args)
- {
- var productName = Console.ReadLine();
- var volume = double.Parse(Console.ReadLine());
- var energyContent = double.Parse(Console.ReadLine());
- var sugarContent = double.Parse(Console.ReadLine());
- var diff = volume / 100;
- var currentEnergy = energyContent * diff;
- var currentSugar = sugarContent * diff;
- Console.WriteLine($"{volume}ml {productName}:");
- Console.WriteLine($"{currentEnergy}kcal, {currentSugar:F1}g sugars");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment