Advertisement
YORDAN2347

SqrtNumsArr

Mar 25th, 2021
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace SqurtNums
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int[] arr = Console.ReadLine()
  11.                 .Split(" ", StringSplitOptions.RemoveEmptyEntries)
  12.                 .Select(int.Parse)
  13.                 .Where(x => Math.Sqrt(x) % 1 == 0)
  14.                 .ToArray();
  15.  
  16.             Console.WriteLine(string.Join(" ", arr));
  17.  
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement