输入三个整数,输出其中最小的数

阅读 144

2022-03-24

import java.util.Scanner;

public class HelloWorld {
    public static void main(String[] args) {
        int a,b,c;
        Scanner input = new Scanner(System.in);
        a=input.nextInt();
        b=input.nextInt();
        c=input.nextInt();
        int d;
        if(a>b&&b>c){
        d=c;
        }else if(a>c&&c>b){
        d=b;
        }else{
        d=a;
        }
       System.out.println(d);
    }
}

精彩评论(0)

0 0 举报