第三章 第3题

时间:2021-01-18 06:09:48
package com.bdqn.doum;
import java.util.Scanner;
public class Demo4 {
 public static void main(String[] args) {
  int temp = 0;
  Scanner input = new Scanner(System.in);
  System.out.println("请输入3个整数");
  int a = input.nextInt();
  int b = input.nextInt();
  int c = input.nextInt();
  if (a > b) {
   temp = a;
   a = b;
   b = temp;
  }
  if (a > c) {
   temp = a;
   a = c;
   c = temp;
  }
  if (b > c) {
   temp = b;
   b = c;
   c = temp;
  }
  System.out.println("a的值:" + a + "b的值:" + b + "c的值:" + c);
 }
}