解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void Sort(int a,int b,int c){
int temp;
if(a>b){
temp = b;
b = a;
a = temp;
}
if(a>c){
temp = a;
a = c;
c = temp;
}
if(b>c){
temp = b;
b = c;
c = temp;
}
System.out.print(a+" "+b+" "+c+" ");
}
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Sort(a, b, c);
}
}
0.0分
1 人评分
C二级辅导-等差数列 (C语言代码)浏览:618 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:680 |
川哥的吩咐 (C++代码)浏览:1053 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:1544 |
A+B for Input-Output Practice (C++代码)浏览:623 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:691 |
C语言训练-大、小写问题 (C语言代码)浏览:637 |
简单的a+b (C语言代码)浏览:554 |
WU-C语言程序设计教程(第三版)课后习题12.1 (C++代码)浏览:1017 |
printf基础练习2 (C语言代码)浏览:791 |