//定义可变参数params类型,可随着传入参数的个数改变形参总数组的大小 GetMaxNumbers(params int[] pms) { int max = pms[0]; for(int i =1;imax){ max = pms[i]; } } return max; }