数组提升

来源:互联网 发布:杭州编程培训课费 编辑:程序博客网 时间:2024/05/21 18:43

 

class Promote {
 public static void main(String[]args) {
  int []t = {36,49,59,61,75,82,100};
  promote(t);
  view(t);
 }
 public static void view(int[] x) {
  for(int i=0;i<x.length;i++) {
   System.out.println(x[i]);
  }
 }
 public static void promote(int[]x) {
  for(int i=0;i<x.length;i++) {
   x[i]=(int)(Math.sqrt(x[i])*10);
  }
 }
}
原创粉丝点击