You are viewing a single comment's thread. Return to all comments →
float[] valores = {0,0,0}; // plus, minus, 0 foreach(int x in arr) { valores[x > 0 ? 0 : x < 0 ? 1 : 2]++; } Console.WriteLine(valores[0]/ arr.Count + "\n" + valores[1]/ arr.Count + "\n" + valores[2]/ arr.Count + "\n");
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 →
float[] valores = {0,0,0}; // plus, minus, 0 foreach(int x in arr) { valores[x > 0 ? 0 : x < 0 ? 1 : 2]++;
} Console.WriteLine(valores[0]/ arr.Count + "\n" + valores[1]/ arr.Count + "\n" + valores[2]/ arr.Count + "\n");