题目来源:牛客网 编程初学者入门训练 BC134 KiKi的最高分
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// 1.获取输入的三个整数
Scanner sc = new Scanner(System.in);
int a; // a为描述程序设计基础分数的变量
int b; // b为描述高数分数的变量
int c; // c为描述英语分数的变量
int max; // max为描述最高分数的变量
a = sc.nextInt();
// 2.比对,找最高分数
// 假设a为最高分数
max = a;
b = sc.nextInt();
if(max < b) {
max = b;
}
c = sc.nextInt();
if(max < c) {
max = c;
}
// 3.按格式输出最高分数
System.out.println(max);
}
}