public class disi{
public static void main(String arg[]){
int shuzu[]={1,3,4,5,6,6,5,4,7,6,7,5};
he(shuzu);
sort(shuzu);
}
public static void he(int temp[]){
int sum=0;
for(int i=0;i<temp.length;i++){
sum+=temp[i];
}
System.out.println("数组的和:"+sum);
}
public static void sort(int temp[]){
int max=0;
int min=0;
max=min=temp[0];
for(int i=1;i<temp.length;i++){
if(temp[i]>max){
max=temp[i];
}
if(temp[i]<min){
min=temp[i];
}
}
System.out.println("数组的max:"+max);
System.out.println("数组的min:"+min);
}
}
原文:http://www.cnblogs.com/hao520-/p/5336448.html