• + 0 comments

    I feel this same as well but I still have a lengthy code

        int n = Convert.ToInt32(Console.ReadLine());        
        string[] arr_temp = Console.ReadLine().Split(' ');  
        int[] arr = Array.ConvertAll(arr_temp,(p)=>Int32.Parse(p));     
        double positive= arr.Where((x) => x > 0).Count();        
        double negative =arr.Where((x) => x < 0 ).Count();       
        double zero =arr.Where((x) => x == 0) .Count();     
        double b = Math.Round(negative/n, 6, MidpointRounding.AwayFromZero);
        Console.WriteLine("{0}\n{1}\n{2}\n",Math.Round(positive/n, 6, MidpointRounding.AwayFromZero),Math.Round(negative/n, 6, MidpointRounding.AwayFromZero),Math.Round(zero/n, 6, MidpointRounding.AwayFromZero)
                          );