GerganaTsirkova

GrandpaStavri

Oct 10th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 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 DiadpStavri
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double n = double.Parse(Console.ReadLine());
  14.             double litri;
  15.             double gradus;
  16.             double gradusRakia = 0;
  17.             double litriTotal = 0;
  18.             double gradusRakiaTotal = 0;
  19.             for (int i = 0; i < n; i++)
  20.             {
  21.                 litri = 0;
  22.                 gradus = 0;
  23.                 litri = double.Parse(Console.ReadLine());
  24.                 gradus = double.Parse(Console.ReadLine());
  25.                 gradusRakia = litri * gradus;
  26.                 litriTotal += litri;
  27.                 gradusRakiaTotal += gradusRakia;
  28.             }
  29.             gradusRakiaTotal =(gradusRakiaTotal/litriTotal);
  30.             Console.WriteLine("Liter: {0:f2}",litriTotal);
  31.             Console.WriteLine("Degrees: {0:f2}",gradusRakiaTotal);
  32.  
  33.             if (gradusRakiaTotal < 38)
  34.             {
  35.                 Console.WriteLine("Not good, you should baking!");
  36.             }
  37.             else if ((gradusRakiaTotal<=38)&&(gradusRakiaTotal<=42))
  38.             {
  39.                 Console.WriteLine("Super!");
  40.             }
  41.             else if (gradusRakiaTotal>42)
  42.             {
  43.                 Console.WriteLine("Dilution with distilled water!");
  44.             }
  45.  
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment