Advertisement
social1986

Untitled

Sep 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 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 _3.Search_for_a_Number
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var numbersList = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  14. var numbersArray = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  15. bool check = true;
  16.  
  17. for (int i = numbersArray[1]; i < numbersArray[0]; i++)
  18. {
  19. if (numbersList[i] == numbersArray[2])
  20. {
  21. Console.WriteLine("YES!");
  22. check = false;
  23. break;
  24. }
  25. }
  26. if (check == true)
  27. {
  28. Console.WriteLine("NO!");
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement