C#小程序
文章平均质量分 75
张永恒
IT
展开
-
C# 随机产生一定长度数组并对其排序
using System; using System.Collections.Generic; using System.Linq; using System.Text; ///对数组进行排序 namespace 冒泡排序 { class Program { static void Main(string[] args) {原创 2013-10-09 10:24:38 · 915 阅读 · 0 评论 -
简单说说委托
委托:百度百科给出的词语释义是:【释义】把事情托付给别人或别的机构(办理) 在C#中,大多时候,方法的参数是数据,但有时我们会想将 方法 作为参数,这时,我们就可以用委托。 委托一般情况下会和事件一起使用,事件说白了也是特殊的一个方法。 先看个例子吧: 有很多方法,比如求平方,求阶乘…… 想让用户输入值,求该值的平方,阶乘…… using System; using System.原创 2013-10-10 09:57:21 · 481 阅读 · 0 评论 -
求一些随机数中连续的数(2个或者2个以上)的和
求一些随机数中连续的数(2个或者2个以上)的和 比如{1,2,7,3,4,5,9,0,2,3},则连续的数(2个或者2个以上)的和Sum为:Sum=(1+2)+(3+4+5)+(2+3)=20; 比如{9,10,4,2,5,8,1,2,0,7},则连续的数(2个或者2个以上)的和Sum为:Sum=(9+10)+(1+2)=22; 下面的程序,为了简单起见,默认共10个数,由系统随机产生,这组原创 2013-10-12 17:13:18 · 692 阅读 · 0 评论 -
C# 日期计算
日期计算,用 C# 控制台 写的程序。 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace 计算日期 { class Program { /// //原创 2013-11-06 16:38:28 · 785 阅读 · 1 评论