Mục blog của 102322020 陳明慈

Hình của 102322020 陳明慈
Bởi 102322020 陳明慈 - Monday, 20 April 2015, 6:24 PM
Bất kỳ ai trên thế giới

import java.util.Scanner;

public class practice0420
{

public static void main(String[] args){

double numbera,numberb,numberc,min,mean;

java.util.Scanner input=new Scanner(System.in);

System.out.println("input number a:");
numbera=input.nextDouble();

System.out.println("input number b:");
numberb=input.nextDouble();

System.out.println("input number c:");
numberc=input.nextDouble();

min=methodA(numbera,numberb,numberc);
System.out.println("the min is : "+min);


System.out.println("the mean is : "+mean);

}


public static double methodA(double numbera,double numberb,double numberc){

double i;

if(numbera>numberb)i=numberb;
else i=numbera;

if(numberc>i)i=i;
else i=numberc;


return i;
}

public static double methodB(double numbera,double numberb,double numberc){

double i;

i=(numbera+numberb+numberc)/3.0;


return i;
}

}

[ Đã được sửa: Monday, 20 April 2015, 6:24 PM ]
 

  
RSS