Facebook
From Младен, 3 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 612
  1. using System;
  2.  
  3. namespace _04._Grandpa_Stavri
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             double totalLiters = 0;
  11.             double totalLitersWithVol = 0;
  12.             double averageVol = 0;
  13.             for (int i = 1; i <= n; i++)
  14.             {
  15.                 double liters  = double.Parse(Console.ReadLine());
  16.                 double volPercent = double.Parse(Console.ReadLine());
  17.                 double litersWithVol = liters * volPercent;
  18.                 totalLitersWithVol += litersWithVol;
  19.                 totalLiters += liters;
  20.                 averageVol = totalLitersWithVol / totalLiters;
  21.             }
  22.             Console.WriteLine($"Liter: {totalLiters:f2}");
  23.             Console.WriteLine($"Degrees: {averageVol:f2}");
  24.             if(averageVol < 38)
  25.                 Console.WriteLine("Not good, you should baking!");
  26.             else if(averageVol < 42)
  27.                 Console.WriteLine("Super!");
  28.             else
  29.                 Console.WriteLine("Dilution with distilled water!");
  30.         }
  31.     }
  32. }
  33.  

Replies to 04. Grandpa Stavri rss

Title Name Language When
Re: 04. Grandpa Stavri Cute Meerkat python 2 Years ago.
Re: 04. Grandpa Stavri Rude Owl javascript 3 Years ago.