質問: 0; i < n.Length; i++) { if ( 0 >= n[i]) { Console.Write(n[i] + "個"); } } Console.WriteLine(); } private static void printf(string v, int count_a) { throw new NotImplementedException(); } } } ```
回答: ``` using System; using System.Linq; public class Program { public static void Main() { var n = new[]{-3,-2,-1,0,1,2,3}; Console.WriteLine($"0 より大は {n.Count(x=>x > 0)} 個"); Console.WriteLine($"0 より小は {n.Count(x=>x < 0)} 個"); Console.WriteLine($"0 は {n.Count(x=>x == 0)} 個"); } } ```