1. public static void main(String[] args) {
    2. int[] result = calculate(10,20,30);
    3. System.out.println("总和:" + result[0]);
    4. System.out.println("平均数:" + result[1]);
    5. }
    6. public static int[] calculate(int a,int b,int c){
    7. int sum = a + b + c;
    8. int avg = sum / 3;
    9. int[] array = {sum, avg};
    10. return array;
    11. }