求大神帮画一个Java流程图
发布网友
发布时间:2022-04-22 03:34
我来回答
共1个回答
热心网友
时间:2023-11-03 14:10
import java.util.Scanner;
public class Test{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
System.out.println("请输入3个数字");
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
System.out.println(" a = " + a);
System.out.println(" b = " + b);
System.out.println(" c = " + c);
sc.close();
System.out.println("重新排序后:");
int temp;
if( a > b ){
temp = b;
b = a;
a = temp;
}
if( a > c ){
temp = c;
c = a;
a = temp;
}
if( b > c ){
temp = c;
c = b;
b = temp;
}
System.out.println(" a = " + a);
System.out.println(" b = " + b);
System.out.println(" c = " + c);
}
}