package pta2;
/*try{
*
*
-
}catch (Exception e){
-
}
-
异常处理机制
-
*/
import java.util.Scanner;
public class Pta6 {
public static void main(String[] args) {
int t[] = new int[4];
int a=1;
int b;
int c=1000 ;
int sum = 0;
try {
Scanner ace = new Scanner(System.in);
for(int i =0 ;i<4;i++){
t[i] = ace.nextInt();
if(t[i]>=0&&t[i]<10)
continue;
else
if(t[i]10)
a=2;
}
if(a1){
for(int i =0;i<4;i++)
for(int j = 0;j<3-i;j++){
if(t[j+1]>t[j]){
b = t[j];
t[j]= t[j+1];
t[j+1]=b;
}
}
for(int i = 0;i<4;i++){
sum = sum + t[i]*c;
c =c /10;
}
System.out.print(sum+" ");
c = 1000;
sum = 0;
for(int i = 3;i>=0;i–){
sum = sum +t[i]*c;
c = c/10;
}
System.out.println(sum);
}
if(a==2)
System.out.println("Numerical range error");
}catch(Exception e){
System.out.println("number input error");
}
}
}