2012年12月15日

摘要: static void Main(string[] args) { Console.WriteLine("请输入个正数:"); int I= int.Parse(Console.ReadLine()); Console.WriteLine("第{0}个数字是{1}", I, Fn(I)); } static int Fn(int n) { if ( n == 1 || n == 2 ) { return 1; } else { return Fn(n - 1) + Fn(n - 2); } } } 阅读全文
posted @ 2012-12-15 19:50 夜空中最亮的星* 阅读(356) 评论(3) 推荐(0) 编辑
 
摘要: namespace ConsoleApplication1{ class Program { static void Main(string[] args) { Console.WriteLine("请输入数字:"); string s = Console.ReadLine(); Console.Write("转换后¥:"); for (int i = 0; i < s.Length; i++) {//switch(Convert.ToInt32(Console.ReadLine())) switch (s[i] - 48) { case 0: C 阅读全文
posted @ 2012-12-15 19:48 夜空中最亮的星* 阅读(651) 评论(4) 推荐(0) 编辑