You are viewing a single comment's thread. Return to all comments →
Java 7 Solution
double postiveNum=0,negativeNum=0;
for(int x : arr) { if(x>0) postiveNum++; else if(x<0) negativeNum++; } System.out.printf("%.6f\n",(postiveNum/arr.size())); System.out.printf("%.6f\n",(negativeNum/arr.size())); System.out.printf("%.6f\n",((arr.size()-(postiveNum+negativeNum))/arr.size()));
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 →
Java 7 Solution
double postiveNum=0,negativeNum=0;