import java.util.Scanner; /** * @author 蓝色以太 输入两个整数,放入到a与b变量中去,如果a>b就将a与b中的值进行交换,否则就不交换。 */ public class Change { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入两个整数:"); int a = sc.nextInt(); int b = sc.nextInt(); if (a > b) { int t = a; a = b; b = t; } System.out.println(a + "," + b); } }
时间: 2024-12-19 08:53:57