C#采用递归的方法求斐波那契数列的任意项的数值
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 斐波那契数列{ class Program { /// /// 采用递归的方法求斐波那契数列的第15项的数值 /// /// static void Main(string[] args) { Console.WriteLine("请输入要输出斐波那契数列哪一项的数值:"); int number = Convert.ToInt32(Console...
阅读全文
posted @
2013-11-21 10:55
相约看日出
阅读(1237)
推荐(0)
C#冒泡排序,给定一组数据按照从大到小排序
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 冒泡排序{ class Program { /// /// 冒泡排序,给定一组数据1,12,23,8,5,20,按照倒序排序(从大到小) /// /// static void Main(string[] args) { int[] sums = { 1, 12, 23, 8, 5, 20 }; for (int i = 0; i < sums.L...
阅读全文
posted @
2013-11-21 10:51
相约看日出
阅读(1940)
推荐(0)
C#在屏幕上输出一个5行5列的菱形
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 打印一个菱形{ class Program { /// /// 在屏幕上输出一个菱形,5行5列 /// /// * /// *** /// ***** /// *** /// * /// 将菱形分成两部分输出,上半部分3行,下半部分2行 static void Main(string[] args) { f...
阅读全文
posted @
2013-11-20 17:31
相约看日出
阅读(983)
推荐(0)