java if语句 number1 number2 number3 取最小值应该怎么写

2020-09-06 教育 86阅读
import java.util.*;
public class shao
{
public static void main(String[] args)
{

Scanner in=new Scanner(System.in);
System.out.print("input number1:");
double number1=in.nextDouble();
System.out.print("\n"+"input number2:");
double number2=in.nextDouble();
System.out.print("\n"+"input number3:");
double number3=in.nextDouble();
double min=number1;
System.out.println("3个整数求和:"+(number1+number2+number3));
System.out.println("3个整数求积:"+(number1*number2*number3));
System.out.println("3个整数求平均数:"+(number1+number2+number3)/3);
if(min if(min if(min System.out.println("3个整数的最小值:"+min);
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com