You are viewing a single comment's thread. Return to all comments →
public static void plusMinus(List<int> arr) { int p = 0, n = 0, z = 0, l = arr.Count; foreach(int el in arr) { if(el > 0) p++; else if(el < 0) n++; else if(el == 0) z++; }; decimal pD = p, nD = n, zD = z; Console.WriteLine((pD/l).ToString("F6")); Console.WriteLine((nD/l).ToString("F6")); Console.WriteLine((zD/l).ToString("F6")); }
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →