Lists and Matrices Lab - 6.Square Numbers
Здравейте,
Условието е: Read a list of integers and extract all square numbers from it and print them in descending order. A square number is an integer which is the square of any integer. For example, 1, 4, 9, 16 are square numbers.
Получавам в Judge само 75 точки. Защо?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _6
{
class Program
{
static void Main(string[] args)
{
List<int> spis = Console.ReadLine().Split(' ').Select(int.Parse).OrderByDescending(a => a).ToList();
foreach (var item in spis)
{
double help = Math.Sqrt(item);
if ( help * help == item)
Console.Write(item + " ");
}
}
}
}