import java.util.Scanner;
public class Main {
public static void main(String args[]){
System.out.println("Please input the first number:");
System.out.println("Please input the second number:");
System.out.println("Please input the third number:");
Scanner in = new Scanner(System.in);
int a= in.nextInt();
int b= in.nextInt();
int c= in.nextInt();
int max;
if (a>=b&&a>=c)max=a;
else if (b>=a&&b>=c)max=b;
else max=c;
System.out.printf("The maximum number is:%d",max);
}
}
Java-请编写一个方法实现如下功能: 输出任意三个整数 a,b,c中最大的一个,并打印出来
最新推荐文章于 2024-05-08 15:24:52 发布