上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: 利用委托可以查找满足自定义条件的数值:测试代码:class Program { static void Main(string[] args) { List<int> list = new List<int>(); list.Add(1); list.Add(2); list.Add(3); list.Add(2); List<int> result = list.FindAll(Even); foreach (int number in result) { Console.WriteL... 阅读全文
posted @ 2012-04-08 14:43 wouldguan 阅读(798) 评论(0) 推荐(0) 编辑
摘要: 输入:31 1 3输出:11 11 1 31 33Delphi代码:unit unrepeat_combination;const max_n = 10;var n, m: integer; rcd, num, used: array[0..max_n] of integer;procedure unrepeat_combination(index, p: integer);var i: integer;begin if index > 0 then begin for i := 0 to index - 2 do Write(rcd[i], ' '); wr... 阅读全文
posted @ 2012-04-06 20:22 wouldguan 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 输入:31 2 3输出:11 21 2 31 322 33Delphi代码:program full_combination;const max_n = 10;var n: integer; rcd, num: array[0..max_n] of integer;procedure full_combination(index, p: integer);var i: integer;begin //每次都输出 if index > 0 then begin for i := 0 to index - 2 do Write(rcd[i], ' '); wri... 阅读全文
posted @ 2012-04-06 20:20 wouldguan 阅读(1524) 评论(0) 推荐(0) 编辑
摘要: 输入:4 31 2 3 4输出:1 2 31 2 41 3 42 3 4Delphi代码:program select_combination;const max_n = 10;var n, m: integer; rcd, num: array[0..max_n] of integer;procedure select_combination(index, p: integer);var i: integer;begin if index = m then begin for i := 0 to m - 2 do Write(rcd[i], ' '); wr... 阅读全文
posted @ 2012-04-06 20:15 wouldguan 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 输入:31 1 2输出:1 1 21 2 12 1 1Delphi代码:program unrepeat_permutation;//不重复排列const max_n = 10;var n, m: integer; rcd, used, num: array[0..max_n] of integer;procedure unrepeat_permutation(index: integer);var i: integer;begin if index = n then begin for i := 0 to n - 2 do Write(rcd[i], ' '); ... 阅读全文
posted @ 2012-04-06 20:12 wouldguan 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 输入:31 2 3输出:1 2 31 3 22 1 32 3 13 1 23 2 1Delphi代码:program full_permutation;//全排列const max_n = 10;var n: integer; rcd, used, num: array[0..max_n] of integer;procedure full_permutation(index: integer);var i: integer;begin if index = n then begin for i := 0 to n - 2 do Write(rcd[i], ' ')... 阅读全文
posted @ 2012-04-06 20:08 wouldguan 阅读(1807) 评论(0) 推荐(0) 编辑
摘要: 输入样例:3 2输出样例:0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1Delphi 代码:program loop_permutation;//类循环排列const max_n = 10;var n,m: integer; rcd: array[0..max_n] of integer;procedure loop_permutation(index: integer);var i: integer;begin if index=n then begin for i := 0 to index - 1 do begin wr... 阅读全文
posted @ 2012-04-06 19:52 wouldguan 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 一些简单的测试代码: static int? GetNullableInt() { return null; } static string GetStringValue() { return null; } static void Main() { int? x = null; int y = x ?? -1; Console.WriteLine("y={0}", y);//y=-1 int i = GetNullableInt() ?? default(int); Cons... 阅读全文
posted @ 2012-03-30 09:27 wouldguan 阅读(170) 评论(0) 推荐(0) 编辑
摘要: C# 类的成员的默认修饰符是: private类是: internalstruct是值类型 class是引用类型这是一个简单的测试:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace StructTypeDemo{ public struct TheStruct { public int x; } public class TheClass { public int x; } class StructType { public s... 阅读全文
posted @ 2012-03-29 22:12 wouldguan 阅读(130) 评论(0) 推荐(0) 编辑
摘要: //播放.MP3文件: uses mmsystem;//開始播放: procedure TForm1.Button1Click(Sender: TObject); begin MCISendString('OPEN e:\1.mp3 TYPE mpegvideo alias ww',nil, 0, 0); MCISendString('PLAY WW', nil, 0, 0); MCISendString('CLOSE ANIMATION', nil, 0, 0); end; //停止播放 procedure TForm1.Button2Clic 阅读全文
posted @ 2012-03-19 23:59 wouldguan 阅读(1046) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页