public class B {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] a=new int[]{10,20,30};
int[] b=new int[]{40,50,60};
int[] c=new int[a.length+b.length];
System.out.print("第一组元素:");
for(int i=0;i<a.length;i++){
System.out.print(a[i]+" ");
}
System.out.println();
System.out.print("第二组元素:");
for(int i=0;i<b.length;i++){
System.out.print(b[i]+" ");
}
for(int i=0;i<c.length;i++){
if(i<a.length){
c[i]=a[i];
}else{
c[i]=b[i-a.length];
}
}
System.out.println();
System.out.print("合并的元素: ");
for(int i=0;i<c.length;i++){
System.out.print(c[i]+" ");
}
System.out.println();
System.out.print("逆序:");
for(int i=c.length-1;i>=0;i--){
System.out.print(c[i]+" ");
}
}
}