摘要: 编写一个方法用于验证指定的字符串是否为反转字符,返回true和false。请用递归算法实现View Code static void Main(string[] args) { string[] strs = { "cabgfcgfbac", "ab", "abc", "abcca" }; foreach (string str in strs) Console.WriteLine("{0} is {1}", str, method(str)); Console.Rea... 阅读全文
posted @ 2013-02-26 16:34 GLenn-Cui 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 将一整数逆序,如987654321变为123456789。View Code static void Main(string[] args) { int[] numbers = new int[] { 9, 8, 7, 6, 5, 4, 3, 2, 1 }; for (int i = numbers.Length - 1; i >= 0; i--) { var dd = numbers[i]; Console.WriteLine(dd); ... 阅读全文
posted @ 2013-02-26 16:20 GLenn-Cui 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 在网上找了一个简单的。这个题经常在面试中出现。一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30个是多少答案:View Code static void Main(string[] args) { int dd= Func(4); Console.WriteLine(dd); Console.ReadLine(); } public static int Func( int n) { if (... 阅读全文
posted @ 2013-02-26 16:02 GLenn-Cui 阅读(119) 评论(0) 推荐(0) 编辑