アットウィキロゴ

おおお9

package mathx;
 
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
 
class pro{
 
public static void main(String[] args) {
 
pro test=new pro();
}
 
pro(){
 
String st="43.6, 45.2, 45.4, 45.8, 47.2, 47.8, 48.2, 48.7, 48.8, 48.9, 49.0, 49.0, 49.4,";
st=st+"49.5, 49.8, 50.4, 50.5, 50.9, 50.9, 51.2, 51.2, 51.2, 51.3, 51.3, 51.6, 51.7,";
st=st+"51.7, 51.8, 52.0, 52.0, 52.1, 52.1, 52.1, 52.2, 52.3, 52.7, 52.7, 52.8, 52.9,";
st=st+"52.9, 53.1, 53.1, 53.8, 54.0, 54.5, 54.5, 54.6, 54.7, 54.7, 54.7, 54.8, 54.9,";
st=st+"55.1, 55.1, 55.2, 55.3, 55.4, 55.4, 55.4, 55.6, 55.7, 55.8, 55.9, 56.1, 56.3,";
st=st+"56.3, 56.3, 56.4, 56.5, 56.7, 56.8, 57.0, 57.1, 57.1, 57.2, 57.3, 57.6, 57.7,";
st=st+"57.8, 58.1, 58.4, 58.6, 58.7, 58.7, 58.7, 58.7, 59.1, 59.3, 59.9, 60.0, 60.1,";
st=st+"60.3, 60.5, 60.6, 60.6, 60.7, 61.3, 62.7, 64.2, 64.6";
 
String[] x=st.split(",");
 
System.out.println(x.length);
 
int s;
 
DescriptiveStatistics ds=new DescriptiveStatistics();
 
for(s=0;s<100;s++){
double z=Double.parseDouble(x[s]);
  ds.addValue(z);
}
 
double avg=ds.getMean();
 
double std = ds.getStandardDeviation();
double m =ds.getPercentile(50);
 
System.out.println(avg);
 
 
}
}
 
最終更新:2016年03月18日 12:34