Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main(string[] args)
- {
- List<int> targets = Console.ReadLine().Split("|").Select(int.Parse).ToList();
- int points = 0;
- char[] sepearator = { ' ', '@' };
- List<string> comand = Console.ReadLine().Split(sepearator).ToList();
- while (comand[0] != "Game over")
- {
- if (comand[0] == "Shoot" && comand[1] == "Left")
- {
- int start = int.Parse(comand[2]);
- int countPositions = int.Parse(comand[3]);
- if (start >= 0 && start < targets.Count())
- {
- for (int i = 0; i > countPositions; i++)
- {
- start = start - 1;
- if (start == -1)
- {
- start = targets.Count() - 1;
- }
- }
- if (targets[start] >= 5)
- {
- points += 5;
- }
- else if (targets[start] < 5)
- {
- points += targets[start];
- targets[start] == 0;
- }
- }
- }
- comand = Console.ReadLine().Split(sepearator).ToList();
- }
- Console.WriteLine(string.Join(" ", targets));
- Console.WriteLine($"Iskren finished the archery tournament with {points}!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement