资源限制
时间限制:1.0s 内存限制:256.0MB
问题描述
编写程序,输入3个整数,求出最大数并输出。
输入格式
输入三个整数,用空格分开。
输出格式
输出三个数的最大值
样例输入
5 3 4
样例输出
5
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a > b && a > c) {
System.out.println(a);
}else if(b > a && b > c) {
System.out.println(b);
}else {
System.out.println(c);
}
}
}