102322020 陳明慈 의 블로그 항목

102322020 陳明慈 사진
월요일, 20 4월 2015, 6:24 오후 에 102322020 陳明慈
누구에게나

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

}

[ 수정됨: 월요일, 20 4월 2015, 6:24 오후 ]