ArrayList a=new ArrayList();
Random b=new Random();
for(int i=0;i<10;i++)
{
  a.Add(b.Next(100));
}用sort()方法对a,按从小到得顺序排序,
能详细讲下Comparer的用法么,谢谢了

解决方案 »

  1.   

    1.vt. 比较;对照。如:Compare your answers with those at the back of the book to see if they are right.把你的答案同书后面的答案对照一下,看看是否正确。My handwriting can not be compared with my father’s.我的书法不能与我父亲的相比。If you compare the two books, you will see that this one is better.如果你比较一下这两本书,你会发现这一本好一些。2.vt. 喻为;比拟。如:Man’s life is often compared do a candle.人生常被比为蜡烛。Shakespeare compared the world to a stage.莎士比亚把人世比做舞台。3.comparison n. 比较;对照。如:He looks older by comparison.比较起来,他显得老些。It is beyond(=out of)all comparison.这是无可比拟的。A critical comparison of Carlyle and Emerson就卡莱尔与爱默生(两人的信条或文学风格)而进行的比较与研究4.词组a fair comparison公正的比较a rough comparison粗略的比较a minute comparison详细比较tabular comparison比较表in comparison with that man与那人相比the basis of comparison比较的基础the countries under comparison相比的各国without(=beyond)comparison无与伦比comparison between nature and art自然与艺术之间的比较comparison of hands笔迹的比较the comparison of one thing to another一样东西比做另一样。如:The comparison of heart to a pump is a very common one.把心脏比成水泵是很常见的比喻。bear(=stand;sustain)a comparison with比得上,不差于challenge comparison with one’s predecessors向前任挑战draw a comparison between then把它们加以比较in/by comparison with与……比较A  train is slow in comparison with a plane.同飞机比较,火车走得慢。
    特别提醒 compare…with…表示“把……与……相比(同类相比)”,compare…to…表示“把……比做……(异类相比,比喻)”。在表示“把……与……相比”时,compare…with与compare…to…皆可用,尤其是用在过去分词作状语的句子中。 
      

  2.   

    string s1="ssssss";
    string s2="ssssSS";
    int ii=string.Compare(s1,s2,true);//比较上面两个字符串是否相等.就是你所说的"字符串变量1,字符串变量2".第三个参数是要不要区分大小写.true是不区分.
    Response.Write(ii);//如果相等返回0.如果不相等返回-1.
      

  3.   

    给你资料,介绍的很详细
    http://space.itpub.net/12639172/viewspace-478292