上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 39 下一页
摘要: /// summary /// 写一个函数处理字符串,比如输入”I am a girl”,输出”girl a am I” /// /summary /// param name="p"/param /// returns/returns private static string StringConvert(string p) { string convertion = null; Stack stack = new Stack(); int i = 0; int j = 0; for (int h = 0; h p.Length; h++) { if (p.Sub 阅读全文
posted @ 2010-04-10 22:03 GT_Andy 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 几道经典的SQL笔试题目(有答案)(1)表名:购物信息购物人 商品名称 数量A 甲 2B 乙 4C 丙 1A 丁 2B 丙 5……(其他用户实验的记录大家可自行插入)给出所有购入商品为两种或两种以上的购物人记录答:select * from 购物信息 where 购物人 in (select 购物人 from 购物信息 group by 购物人 having count(*) = 2);(2)表名:成绩表姓名 课程 分数 张三 语文 81张三 数学 75李四 语文 56李四 数学 90王五 语文 81王五 数学 100王五 英语 49……(其他用户实验的记录大家可自行插入)给出成绩全部合格 阅读全文
posted @ 2010-04-10 19:26 GT_Andy 阅读(905) 评论(0) 推荐(0) 编辑
摘要: 一个很简洁的算法:void Reverse(char s[]){ for(int i = 0, j = strlen(s) - 1; i j; ++i, --j) { char c = s[i]; s[i] = s[j]; s[j] = c; }}#关于a, b交换其它算法: a ^= b; b ^= a; a ^= b;一个五种解法的版本:转自:http://www.cnblogs.com/Mainz/articles/1164602.html这是网络流传的Microsoft的面试题目之一:“编写反转字符串的程序,要求优化速度、优化空间”。因为最近一直很多关注算法方面的实践和研究,因此 阅读全文
posted @ 2010-04-10 19:04 GT_Andy 阅读(3531) 评论(0) 推荐(0) 编辑
摘要: 【引用 《智能家电控制技术》帮助文档 这里有很是HTML版的,很实用好查,但就是不能下载成CHM版的,本地是不能用啊。】1.#operator not followed by macro argument name"#"运算符后无宏变元名。在宏定义中,"#"用于标志一宏变元是一个串,因此,在"#"后面必须要跟随一个宏变元名。2.'xxxxxxxx'not an argument'xxxxxxxx'不是函数参数。在原程序中将该表识符定义为一个函数,但他没有在函数表中出现。3.Ambiguous symbol 'xxxxxxxx'二义性符号'xxxxxxxx'。两个或两个以上结构的某一域名相同,但 阅读全文
posted @ 2010-04-10 18:49 GT_Andy 阅读(4288) 评论(0) 推荐(0) 编辑
摘要: A quick synopsis on the differences between 'const' and 'readonly' in C#:'const': Can't be static. Value is evaluated at compile time. Initiailized at declaration only. 'readonly': Can be either instance-level or static. Value is evaluated at run time. Can be initialized in declaration or by code in 阅读全文
posted @ 2010-04-10 15:59 GT_Andy 阅读(272) 评论(0) 推荐(0) 编辑
摘要: You want to store common data that is only needed in one location, using a singleton or static class. Save state between usages and store some caches. The object must be initialized only once and shared. Here we discuss the singleton pattern and static classes from the C# language with examples.Impl 阅读全文
posted @ 2010-04-09 19:22 GT_Andy 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 使用 static 修饰符声明属于类型本身而不是属于特定对象的静态成员。static 修饰符可用于类、字段、方法、属性、运算符、事件和构造函数,但不能用于索引器、析构函数或类以外的类型。例如,下面的类声明为 static,并且只包含 static 方法。有关更多信息,请参见静态类和静态类成员(C# 编程指南)。 常数或者类型声明隐式地是静态成员。不能通过实例引用静态成员。然而,可以通过类型名称引用它。例如,请考虑以下类: 若要引用静态成员 x,请使用完全限定名(除非可从相同范围访问):尽管类的实例包含该类所有实例字段的单独副本,但每个静态字段只有一个副本。不可以使用 this 来引用静态方法或 阅读全文
posted @ 2010-04-09 18:11 GT_Andy 阅读(2548) 评论(0) 推荐(0) 编辑
摘要: 也是中软笔试的算法题,当时并不知道叫杨辉三角,唉。N年不用了,还得再拾起,为了那个梦。#include stdio.hvoid main() { int a[50][50]; int i,j,n; printf("Please input Number:"); scanf("%d",&n); for (i=0;in;i++) { for (j=0;j=i;j++) { if (j==0 ||j==i) a[i][j]=1; else a[i][j]=a[i-1][j-1]+a[i-1][j]; printf("%5d",a[i][j]); } printf("\n" 阅读全文
posted @ 2010-04-09 16:21 GT_Andy 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 前天的笔试题,但当时记不清楚这些类和方法名了,最后用了伪代码和思路。唉,书到用时方恨少,事非经过不知难,看来古语还是有道理的。using System.IO;public static string pathDir = string.Empty;public static string savePath = string.Empty;public static StringBuilder sb = new StringBuilder();static void Main(string[] args){ pathDir = @"d:\WES 2009 相关资料\"; savePath = @"D 阅读全文
posted @ 2010-04-09 14:24 GT_Andy 阅读(2974) 评论(0) 推荐(0) 编辑
摘要: 引言委托 和 事件在 .Net Framework中的应用非常广泛,然而,较好地理解委托和事件对很多接触C#时间不长的人来说并不容易。它们就像是一道槛儿,过了这个槛的人,觉得真是太容易了,而没有过去的人每次见到委托和事件就觉得心里别(biè)得慌,混身不自在。本文中,我将通过两个范例由浅入深地讲述什么是委托、为什么要使用委托、事件的由来、.Net Framework中的委托和事件、委托和事件对Observer设计模式的意义,对它们的中间代码也做了讨论。将方法作为方法的参数我们先不管这个标题如何的绕口,也不管委托究竟是个什么东西,来看下面这两个最简单的方法,它们不过是在屏幕上输出一句问候的话语: 阅读全文
posted @ 2010-04-08 22:47 GT_Andy 阅读(221) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 39 下一页