标签:res string package int() pack sys ESS 输入 知识
5.输入三个整数x,y,z,请把这三个数由小到大输出(知识点:条件语句)
package text1;
import java.util.Scanner;
public class test14 {
public static void main(String[] args) {
// TODO Auto-generated method stub
//A(90-100),B(80-89),C,D,E
@SuppressWarnings("resource")
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(a>b&&b>c) {
System.out.println(c+"<"+b+"<"+a);
}else if(a>b&&b<c) {
System.out.println(b+"<"+c+"<"+a);
}else if(b>a&&a>c) {
System.out.println(c+"<"+a+"<"+b);
}else if(b>c&&c>a) {
System.out.println(a+"<"+c+"<"+b);
}else if(c>a&&a>b) {
System.out.println(b+"<"+a+"<"+c);
}else if(c>b&&b>a) {
System.out.println(a+"<"+b+"<"+c);
}
}
}
标签:res string package int() pack sys ESS 输入 知识
原文地址:https://www.cnblogs.com/wwsms1/p/12573281.html