• Source
    1. /******************************************************************************
    2.  
    3. Welcome to GDB Online.
    4. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
    5. C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
    6. Code, Compile, Run and Debug online from anywhere in world.
    7.  
    8. *******************************************************************************/
    9. using System;
    10.  
    11. class HelloWorld
    12. {
    13. static void Main()
    14. {
    15. int[] _array_ = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,13,14,42,42,};
    16.  
    17. string _buffer_ = "";
    18. for (int i = 0; i < _array_.Length; ++i)
    19. {
    20. for (int j = 0; j < _array_.Length; ++j)
    21. {
    22. if (j == i)
    23. continue;
    24. if (_array_[j] == _array_[i])
    25. {
    26. _buffer_ += Convert.ToString(_array_[i]) + " ";
    27. }
    28. }
    29. }
    30. Console.WriteLine($"Повторяющиеся элементы массива '_array_':\n{_buffer_}");
    31. string a = Convert.ToString(_array_[1..4]);
    32. Console.WriteLine(a);
    33. }
    34. }