hao520-

第二次作业

 

 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);
 }
}

分类:

技术点:

相关文章:

  • 2021-10-08
  • 2021-08-03
  • 2021-08-10
  • 2022-02-16
  • 2021-08-16
  • 2021-08-24
  • 2021-09-18
猜你喜欢
  • 2022-02-09
  • 2021-12-19
  • 2022-01-09
  • 2022-01-06
  • 2021-12-11
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案