今天碰到一道笔试题:有两数组A、B,长度分别为m、n。用不超过m+n的比较次数找到两个数组中的相同元素。当时没做出来,我现在给出C#版本,算是弥补一点遗憾。using System;using System.Collections.Generic;using System.Linq;using Sy...
分类:
其他好文 时间:
2014-07-08 22:59:43
阅读次数:
247
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace C_编辑基础
{
//枚举的意义就是限定变量的取值范围
enum gender{Male,Female,Unkown}; //声明一个类型,它是枚举类型(定义一个枚举),这个枚举有三个值。...
分类:
其他好文 时间:
2014-07-08 13:38:36
阅读次数:
191
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceConsoleApplication1
{
classProgram
{
staticvoidMain(string[]args)
{
inti=10;//值类型
intj=10;//必须初始化
intk;//不需要初始化
int[]iarr={..
分类:
其他好文 时间:
2014-07-08 09:42:06
阅读次数:
221
linux下是这样定义的:在linux的实现中pthread_t被定义为 "unsigned long int",參考这里Windows下这样定义: /* * Generic handle type - intended to extend uniqueness beyond ...
分类:
其他好文 时间:
2014-07-08 00:46:18
阅读次数:
279
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication6{ class Program { static v...
分类:
其他好文 时间:
2014-07-08 00:44:25
阅读次数:
340
首先,自定义一个类ListViewNF,继承自System.Windows.Forms.ListViewusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Win...
分类:
其他好文 时间:
2014-07-07 11:41:58
阅读次数:
213
Overload:重载就是在同一个类中,方法名相同,参数列表不同.参数列表不同包括:参数的个数不同,参数类型不同. 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace Over....
分类:
其他好文 时间:
2014-07-07 08:55:41
阅读次数:
177
testJsonAsXMLNodeAttributeusing Newtonsoft.Json;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threadi...
分类:
Web程序 时间:
2014-07-06 21:20:53
阅读次数:
193
控制台输出深度数据: using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.Kinect;namespace HelloKinectMatrix{ class...
分类:
其他好文 时间:
2014-07-06 15:23:26
阅读次数:
179
using System.Collections.Generic;using System.Text;using System;namespace Delegate{ //定义委托,它定义了可以代表的方法的类型 public delegate void GreetingDelegate(string...
分类:
其他好文 时间:
2014-07-05 18:50:41
阅读次数:
159