You are viewing a single comment's thread. Return to all comments →
///Java Solution
class Result { public static void plusMinus(List arr) { double countpos=0, countneg=0, countzero=0; double n=arr.size(); for(int i=0;i 0){ countpos++; } else if(arr.get(i) < 0){ countneg++; } else if(arr.get(i)==0){ countzero++; } }
System.out.println(String.format("%.6f", countpos/n)); System.out.println(String.format("%.6f", countneg/n)); System.out.println(String.format("%.6f", countzero/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 →
///Java Solution
class Result { public static void plusMinus(List arr) { double countpos=0, countneg=0, countzero=0; double n=arr.size(); for(int i=0;i 0){ countpos++; } else if(arr.get(i) < 0){ countneg++; } else if(arr.get(i)==0){ countzero++; } }
}