Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 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 DataTypesLab
  8. {
  9. class Program
  10. {
  11.  
  12. static void Main(string[] args)
  13.  
  14. {
  15. int splitCount = int.Parse(Console.ReadLine());
  16. double prizeByPoint = double.Parse(Console.ReadLine());
  17. int totalPoints = 0;
  18. for (int i = 0; i < splitCount; i++)
  19. {
  20. int points = int.Parse(Console.ReadLine());
  21. if (i%2!=0)
  22. {
  23. points *= 2;
  24. }
  25. totalPoints += points;
  26. }
  27. double prize = prizeByPoint * totalPoints;
  28. Console.WriteLine($"The project prize was {prize:f2} lv.");
  29. }
  30.  
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement