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 _3.SearchForANumber
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> numbers = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- List<int> listOperations = new List<int>();
- bool isTrue = false;
- for (int i = 0; i < array[0]; i++)
- {
- listOperations.Add(numbers[i]);
- }
- for (int i = 0; i < array[1]; i++)
- {
- listOperations.RemoveAt(i);
- }
- for (int i = 0; i < listOperations.Count; i++)
- {
- if (listOperations[i] == array[2])
- {
- isTrue = true;
- }
- }
- if (isTrue == true)
- {
- Console.WriteLine("YES!");
- }
- else
- {
- Console.WriteLine("NO!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement