package h1;
import java.util.*;
public class hh1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float a[] = new float[10];
float max = 0,sum = 0;
double aver = 0;
int pos = 0,big = 0,small = 0,deng = 0;
System.out.println("输入十个浮点数据:");
for(int i = 0;i<a.length;i++)
{
a[i] = sc.nextFloat();
sum+=a[i];
if(a[i]>max)
{
max = a[i];
pos = i;
}
}
aver = sum/10;
System.out.println("最大数为"+max+"\n他的位置是:"+(pos+1));
System.out.println("这组数的平均数为:"+aver);
for(int i = 0;i<a.length;i++)
{
if(a[i]>aver)big++;
else if(a[i]==aver)deng++;
else small++;
}
System.out.println("比平均数大的个数有:"+big+"\n比平均数小的个数有:"+small+"\n等于平均数的个数有:"+deng);
/ for(int i = 0;i<a.length/2;i++)
{
float tem = a[i];
a[i] = a[a.length-i-1];
a[a.length-i-1] = tem;
}
/
/ double b[] = new double [10];
for(int i = 0;i<a.length;i++)
{
b[i] = a[9-i];
}
/
int r = a.length-1;
int l = 0;
while(l<r)
{
float tem = a[l];
a[l] = a[r];
a[r] = tem;
l++;
r--;
}
System.out.println("置换后的数据:");
for(int i = 0;i<a.length;i++)
{
System.out.print(a[i]+" ");
}
}
}