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 _47_LookingForANumber
- {
- class LookingForANumber
- {
- static void Main(string[] args)
- {
- List<int> numbers = Console.ReadLine()
- .Split(' ')
- .Select(int.Parse)
- .ToList();
- List<int> condition = Console.ReadLine()
- .Split(' ')
- .Select(int.Parse)
- .ToList();
- numbers = numbers.Take(condition[0]).ToList();
- numbers.RemoveRange(0, condition[1]);
- Console.WriteLine((numbers.Contains(condition[2])) ? "YES!" : "NO!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment