黑马程序员--C#中面向对象与面向过程
---------------------- <ahref="http://edu.csdn.net"target="blank">ASP.Net+Unity开发</a>、<ahref="http://edu.csdn.net"target="blank">.Net培训</a>、期待与您交流! ----------------------
面向过程就是分析出解决问题所需要的步骤,是需要判断语句(if语句、if-else语句、if-else if语句、switch-case语句)来解决,还是需要循环语句(while循环、do-while循环、for循环)来处理,或者运用方法,最后把这些步骤一步一步实现。也就是说面向过程就是简单的处理问题。
比如:
class Program
{
static void Main(string[]args)
{
int[] numbers = { 1, 3, 2, 5, 6, 4};
int sum,max,min;
sum=Js(numbers,out max,out min);
Console.WriteLine("数组的和为:{0} 最大值为:{1} 最小值为:{2}。",sum,max,min);