02 2010 档案
雷:面试时被问到fibonacci
摘要:1 1 2 3 5 8...递归:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticintFibonacciRecursive(intn){if(n==1||n==2)return1;elseif(n>=2){returnFibon...
阅读全文
打印输入字符串的字母所有顺序的排列
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticvoidPrintSequenceString(stringinputStr){if(string.IsNullOrEmpty(inputStr))thrownewArgumentNull...
阅读全文
查找第一次出现的子串位置
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticintReturnIndex(stringinputStr,stringsubStr){if(string.IsNullOrEmpty(inputStr))thrownewArgument...
阅读全文
统计字符出现的次数
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticvoidReturnShowCOunt(stringinputStr){if(string.IsNullOrEmpty(inputStr))thrownewArgumentNullExce...
阅读全文
考虑无符号整数的二进制中1的个数
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticintCountOneInInteger(intvalue){intiter=1;intcount=0;for(inti=0;i<32;i++){if((value&iter...
阅读全文
整数转字符串
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--staticstringTransToString(intvalue){intstep=1000000000;char[]results=newchar[10];intindex=0;if(value...
阅读全文
浙公网安备 33010602011771号