public class Test{
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
System.out.println("请输入第一个整数:");
int a = sc.nextInt();
System.out.println("请输入第二个整数:");
int b = sc.nextInt();
System.out.println("请输入第三个整数:");
int c = sc.nextInt();
Test t = new Test();
double avg = average( a,b, c);
System.out.println("三个数的平均数为:"+avg);
}
public double average(int a,int b,int c){
double avg = (double)((a+b+c)/3.0);
return avg;
}
}
public static double avg(int a,int b,int c){
return (a+b+c)/3.0;
}
public static void main(String[] args){
int a=1,b=2,c=3;
System.out.println(avg(a,b,c));
}
public static double average(int a,int b,int c){
return (a + b + c )/3.0;
}