You are viewing a single comment's thread. Return to all comments →
double zer=0; double pos=0; double neg=0; double si = arr.size(); for(int i = 0;i<arr.size();i++) { if(arr.get(i)>0) { pos++; } else if(arr.get(i)<0) { neg++; } else { zer++; } } double p = pos/si; double ne = neg/si; double z = zer/si; System.out.println(p); System.out.println(ne); System.out.println(z);
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 →