Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _3P.EnduranceRally
- {
- public class EnduranceRally
- {
- public static void Main()
- {
- string[] names = Console.ReadLine().Split();
- double[] zones = Console.ReadLine()
- .Split()
- .Select(double.Parse)
- .ToArray();
- double[] checkPoints = Console.ReadLine().
- Split()
- .Select(double.Parse)
- .ToArray();
- double sum = 0;
- foreach (var person in names)
- {
- foreach (var c in person)
- {
- var firsteLetter = (int)c;
- sum = firsteLetter;
- break;
- }
- for (int i = 0; i < checkPoints.Length; i++)
- {
- for (int j = 0; j < zones.Length; j++)
- {
- if (i == checkPoints[j])
- {
- sum =sum + (zones[j]);
- break;
- }
- else
- {
- sum =sum - (zones[j]);
- }
- break;
- }
- Console.WriteLine(sum);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement