package com.igeek_02;
import java.util.Scanner;
/**
* @ClassName: ScannerTest3
* @Description: 键盘录入三个数据,获取这三个数据中的最大值
* @date 2017年10月11日 下午7:41:20
* Company www.igeekhome.com
*
*/
public class ScannerTest3 {
public static void main(String[] args) {
// 创建对象
Scanner sc = new Scanner(System.in);
// 接收数据
System.out.println("请输入第一个数据:");
int a = sc.nextInt();
System.out.println("请输入第二个数据:");
int b = sc.nextInt();
System.out.println("请输入第三个数据:");
int c = sc.nextInt();
// 如何获取三个数据的最大值
int temp = (a > b ? a : b);
int max = (temp > c ? temp : c);
System.out.println("max:" + max);
}
}