Advertisement
ledkaa

Array Search

Feb 19th, 2023
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Array_Search
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int[] numbers = Console.ReadLine().Split(',').Select(int.Parse).ToArray();
  11. string result = string.Empty;
  12.  
  13. for (int i = 1; i <= numbers.Length; i++)
  14. {
  15. bool isThere = false;
  16. for (int j = 0; j < numbers.Length; j++)
  17. {
  18. if(i==numbers[j])
  19. {
  20. isThere = true;
  21. break; ;
  22. }
  23. }
  24. if (isThere==false)
  25. {
  26. result += i+",";
  27. }
  28.  
  29.  
  30. }
  31. result=result.Trim(result[result.Length - 1]);
  32. Console.WriteLine(result);
  33. }
  34. }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement