bacco

Парична награда: Reward

Feb 4th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Footbal
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var partProject = double.Parse(Console.ReadLine());
  10.             var MoneyReward  = double.Parse(Console.ReadLine());
  11.  
  12.             double points = 0;
  13.  
  14.             for (int i = 1; i <= partProject; i++)
  15.             {
  16.  
  17.                 var countPoints = double.Parse(Console.ReadLine());
  18.  
  19.                 if (i % 2 == 0)
  20.                 {
  21.                     points = points + (countPoints * 2);
  22.                 }
  23.                 else
  24.                 {
  25.                     points = points + countPoints ;
  26.                 }
  27.             }
  28.  
  29.             var reward = points * MoneyReward;
  30.  
  31.             Console.WriteLine($"The project prize was {reward:f2} lv.");
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment