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 Array_Elements_Equal_to_Their_Index
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] array = Console.ReadLine()
- .Split()
- .Select(int.Parse)
- .ToArray();
- string index = string.Empty;
- for (int i = 0; i < array.Length; i++)
- {
- if (i == array[i])
- {
- index += i + " ";
- }
- }
- Console.WriteLine(index);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement