惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
J
Java Code Geeks
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
U
Unit 42
B
Blog
宝玉的分享
宝玉的分享
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - Franky
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
博客园 - 叶小钗

博客园 - symjie

每天学一点AS3.0(五)---声音的控制(5) 每天学一点AS3.0(四)---声音的控制(4) 每天学一点AS3.0(三)---声音的控制(3) 每天学一点AS3.0(二)---声音的控制(2) 每天学一点AS3.0(一)---声音的控制 Jquery json的超强组合 - symjie - 博客园 javascript分页程序 - symjie - 博客园 初试jquery制作一个简单的loading delegate——委派 - symjie - 博客园 sql 分页 Ajax.net和GridView交互 Ajax.net实现loading登陆的效果 - symjie - 博客园 Ajax.net+模态窗口的登陆简单例子 GridView自定义分页(vb) - symjie - 博客园 用下拉列表控制gridview的分页 DataView数据组件 (转) Atlas学习笔记 getElementByTagsName和相关函数的学习 基于Ajax.net的验证
c#冒泡程序
symjie · 2006-10-02 · via 博客园 - symjie

        今天看了一下数据结构(c),突然有一种冲动,想写一下c#的一些算法和数据结构的文章,就从今天开始吧。
       今天的第一个内容是c#冒泡程序。

 1using System;
 2namespace ma
 3{
 4   public class po
 5   
 6     int i;
 7     int temp;
 8     int j;
 9     public void Sort(int[] list)
10     {
11      while(j<list.Length)
12      {
13        for(i=0;i<list.Length-1;i++)
14        {
15         if(list[i]>list[i+1])
16         {
17          temp=list[i];
18          list[i]=list[i+1];
19          list[i+1]=temp;
20         }

21       }

22     j++;
23      }

24     }

25   }

26   public class mainclass
27   {
28       public static void Main()
29       {
30          int[] arry=new int[]{5,8,1,9,0,15,88};
31          po s=new po();
32          s.Sort(arry);
33          for(int m=0;m<arry.Length;m++)
34          {
35            Console.Write("{0}",arry[m]);
36            Console.Write("  ");
37          }

38       }
    
39   }

40}