精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 怎樣隨機(jī)數(shù)生成一數(shù)組,長度為10,隨機(jī)數(shù)為1~100的奇數(shù),求最大值最小值,C#語言

    怎樣隨機(jī)數(shù)生成一數(shù)組,長度為10,隨機(jī)數(shù)為1~100的奇數(shù),求最大值最小值,C#語言
    其他人氣:709 ℃時間:2020-06-21 05:18:53
    優(yōu)質(zhì)解答
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    namespace RandomArray
    {
    class Program
    {
    static void Main(string[] args)
    {
    int[] myRanArray = new int[10];
    Random Ran = new Random();
    for (int j = 0; j < 10; j++)
    {
    myRanArray[j] = 2 * Ran.Next(1,50) - 1;
    }
    Console.WriteLine("the Random Array is:");
    int i=0;
    int max = 0;
    while (i < 10)
    {
    if (myRanArray[i] > max)
    {
    max = myRanArray[i];
    }
    Console.Write("{0} ",myRanArray[i]);
    i++;
    }
    Console.WriteLine("\nThe max number of the array is:{0}",max);
    Console.ReadKey();
    }
    }
    }
    我是初學(xué)者,見笑了.
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版