Blog del usuario: 102322020 陳明慈

de 102322020 陳明慈 - lunes, 20 de abril de 2015, 18:24
Todo el mundo

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;
}

}

[ Modificado: lunes, 20 de abril de 2015, 18:24 ]
 

  
RSS