Quick actions

cmd+k|ctrl+k

Navigation

Languages

정렬

Snippet info

Language

Java

Visibility

public

Author

4041itq

Created

2018-04-22T03:41:23Z

Updated

2018-04-22T11:29:44Z

class Main {
    public static void main(String[] args) {
        int a[]={5,6,9,15,21};
        int b[]={3,7,8,10,20};
        int c[]=new int[10];
        int k=0;
        
        for(int i=0; i<=4; i++)
            c[i]=a[i];
        for(int i=5; i<=9; i++){
            
            c[i]=b[k];
            k++;
        }
        
        for(int i=0; i<=9; i++){
            for(k=i+1; k<=9; k++){
                if(c[i]>c[k]){
                    int temp=c[k];
                    c[k]=c[i];
                    c[i]=temp;
                }
            }
        }
        
        for(int num:c)
            System.out.printf("%d ",num);
    }
}
INFO