zoukankan      html  css  js  c++  java
  • 下午写的一个代码,还没调试

    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace ConsoleApplication1
    {

        class Program
        {

            static int MaxValue(int[] intArray)
            {
                int maxVal = intArray[0];
                for (int i = 1; i < intArray.Length; i++)
                {
                    if (intArray[i] > maxVal)
                        maxVal = intArray[i];
                }
                return maxVal;
            }

            static void Main(string[] args)
            {
                //int[] myArray = {1,23,45,34,53,52,64,111};
                //int maxVal = MaxValue(myArray);
                //Console.Write("数组中的最大值是:{0}",maxVal);
                //Console.ReadKey();

                int[] myArray ={0,0,0,0,0 };
                int i=0;

                do
                {
                Console.Write("请输入N个数据,用逗号隔开!");
                myArray[i] = Convert.ToInt32(Console.ReadLine());
                i++;
                }while(Console.ReadLine().ToString() != "e");

                int max =MaxValue(myArray);

             //   max(a,b);
                Console.WriteLine("你输入的最大值是:{0}", max);
                Console.ReadKey();
            }
        }
    }

  • 相关阅读:
    暂存未看的网址
    学习springboot+shiro的实际应用demo
    mapper.xml 的配置
    使用idea搭建Spring boot+jsp的简单web项目
    一文读懂SpringCloud与Eureka,Feign,Ribbon,Hystrix,Zuul核心组件间的关系
    .net core mvc 类库读取配置文件
    .net Core 2.0应用程序发布到IIS上注意事项
    Dapper扩展
    C# 请求Https
    js 记录
  • 原文地址:https://www.cnblogs.com/gfwei/p/524470.html
Copyright © 2011-2022 走看看