hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › 1360393788 › 日志

输入三个数,找出最大一个数,并打印出来  

2022-08-05 16:51:21 查看(53) 回复(0)

 

package test_07_15;

import java.util.Scanner;

public class test_07 {
    public static void main(String[] args) {
        while (true) {
            int a, b, c, d;
            Scanner sc = new Scanner(System.in);
            a = sc.nextInt();
            b = sc.nextInt();
            c = sc.nextInt();
            if (a > b) {
                d = a;
                a = b;
                b = d;
            }
            if (a > c) {
                d = a;
                a = c;
                c = d;
            }
            if (b > c) {
                d = b;
                b = c;
                c = d;
            }
            System.out.println(a + "<" + b + "<" + c);
        }
    }
}

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部