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();
            }
        }
    }

  • 相关阅读:
    Google Guava官方教程(中文版)
    maven POM.xml 标签详解
    Linux内存文件系统tmpfs(/dev/shm)详细介绍
    linux 如何查看目录的剩余空间大小?
    CSS position绝对定位absolute relative
    java 笔记
    js笔记
    AFNetworking监控网络状态以及下载的进度条显示
    HTTPS网络请求时plist文件的设置
    KVO监测tableView的滑动
  • 原文地址:https://www.cnblogs.com/gfwei/p/524470.html
Copyright © 2011-2022 走看看