日期:2014-05-20 浏览次数:20693 次
public class test{
public static void main(String[] args){
int[] array={1,2,3,4,5};
int i;
solve(array);
for(i=0;i<array.length;i++)
System.out.print(array[i]+" ");
}
public static void solve(int[] array){
int i;
for(i=0;i<array.length;i++)
array[i]--;
}
}
public class test{
public static void main(String[] args){
printMax(34,3,56);
}
public static void printMax(int[] numbers){
if(numbers.length==0){
System.out.println("No argument passed");
return;
}
double result = numbers[0];
for(int i=1;i<numbers.length;i++)
if(numbers[i]>result)
result = numbers[i];
System.out.println("The max value is " + result);
}
}