Advertisement
simonradev

FixedCode

Aug 1st, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 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 Парична_награда
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int partsProjects = int.Parse(Console.ReadLine());
  14.             double priceForPoint = double.Parse(Console.ReadLine());
  15.             var sum = 0;
  16.  
  17.             var TotalPrice = 0.0;
  18.             for (int i = 1; i <= partsProjects; i++)
  19.             {
  20.                 var points = int.Parse(Console.ReadLine());
  21.  
  22.                 if (i % 2 == 0)
  23.                 {
  24.                     // SUKRATENO
  25.                     points *= 2;
  26.  
  27.                 }
  28.  
  29.                 sum += points;
  30.             }
  31.  
  32.             TotalPrice = (sum * priceForPoint);
  33.  
  34.             Console.WriteLine($"The project prize was {TotalPrice:F2} lv.");
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement