![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c#学习
文章平均质量分 66
iwy_j
这个作者很懒,什么都没留下…
展开
-
c#学习第五天 枚举和结构体
//enum在c#中可以再创建一个.cs文件,也可以在默认的cs文件里面创建(program.cs) //enum和类是同等级关系 enum Color{ red, green, yellow, blue } class Program{ static void Main(string[] args){ Color c = (C原创 2017-07-31 16:48:12 · 294 阅读 · 0 评论 -
c#中的观察者设计模式
//观察者模式 interface Subject { void Notify(); string SubjectState{set;get;} } //事件委托管理 delegate void PatrolHandle(); class Teacher :Subject { //事件和委托最主要的区别就是事件不能当做形参传递,但是委托可以 public event原创 2017-08-16 21:02:21 · 276 阅读 · 0 评论 -
c#第三天 三大循环语句和一维数组
循环结构----while 语法格式:while(条件判断){循环体;} 小案例:输出十句hello world int x=0; while(x Console.WhiteLine("hello world"); x++; } 2.打印五十份卷子,输出显示 int x= 5; while(x>0){ Console.WhiteLine("还剩下{原创 2017-07-27 17:53:25 · 677 阅读 · 0 评论 -
c#学习第四天
1.冒泡排序:冒泡排序设计到双循环,外层控制趟数,内层循环控制比较次数 int[] array ={8,6,4,1}; for(int i = 0; i for(int j=0;j if(array[j]>array[j+1]){ int temp = array[j];//定义一个变量作为交换暂时存放的值原创 2017-07-28 20:38:47 · 160 阅读 · 0 评论 -
c#中选择排序和冒泡排序比较
//冒泡排序 冒泡排序需要双循环一个是趟数 一个是循环次数 int [] array ={12,22,11,21,32,25,26,70}; int temp; for(int i = 1; i for(int j =1; j if(array[j-1]>array[j]){ temp = array[j-1];原创 2017-07-30 17:14:08 · 2814 阅读 · 0 评论