Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. namespace ConsoleApp1
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. var projectParts = int.Parse(Console.ReadLine());
  9. var moneyAward = double.Parse(Console.ReadLine());
  10.  
  11. double totalScore = 0.0;
  12. double currentAddition = 0.0;
  13. for (int i = 1; i <= projectParts; i++)
  14. {
  15. var scoreForCurrentPart = double.Parse(Console.ReadLine());
  16.  
  17. if (i % 2 == 0)
  18. {
  19. currentAddition = scoreForCurrentPart * 2;
  20. }
  21. else
  22. {
  23. currentAddition = scoreForCurrentPart;
  24. }
  25. totalScore += currentAddition;
  26. }
  27. double award = moneyAward * totalScore;
  28. Console.WriteLine($"The project prize was {award:f2} lv.");
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement