import java.util.Scanner; public class MaxNumber{ public static void main(String[] args) { System.out.print("a:"); int a = new Scanner(System.in).nextInt(); System.out.print("b:"); int b = new Scanner(System.in).nextInt(); System.out.print("c:"); int c = new Scanner(System.in).nextInt(); int maxnum = (a>b)?((a>c)?a:c):((b>c)?b:c); System.out.println("输入的三数中最大的数为:"+maxnum); } }运行结果
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)