no pain no gain

hard working

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
class Data_structure
    
{
        
public static void Main()
        
{
            
int []la={3,5,8,11};
            
int []lb={2,6,8,9,11,15,20};
            
int []lc=new int[11];
            
int i=0,j=0,k=0;
        
while(i<la.Length && j<lb.Length)
            
{
                
if(la[i]<=lb[j])
                
{
                    lc[k
++]=la[i++];
                }

                
else
                
{
                    lc[k
++]=lb[j++];
                }
                
            }

            
while(i<la.Length)
            
{
                lc[k
++]=la[i++];
            }

            
while(j<lb.Length)
            
{
                lc[k
++]=lb[j++];
            }
  
            
foreach(int element in lc)
                Console.Write(element
+"\t");
            Console.Read();
        }

    }
posted on 2006-09-24 11:57  龚明秋  阅读(166)  评论(0编辑  收藏  举报