You are viewing a single comment's thread. Return to all comments →
Java Solution
double pos=0,neg=0,zero=0,count=0; for(int i:arr){ if(i>0) pos++; if(i<0) neg++; if(i==0) zero++; count++; } System.out.println(String.format("%.6f", pos/count)); System.out.println(String.format("%.6f", neg/count)); System.out.println(String.format("%.6f", zero/count));
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 Solution