zoukankan      html  css  js  c++  java
  • c#数组,例题

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace ConsoleApplication数组
    {
        class Program
        {
            static void Main(string[] args)
            {
               // string [] shuzu=new string[7];
                //定义方式1,写上开辟多少个空位;

                //定义方式2,不懈开辟多少个空位,但是需要直接赋值,元素与元素之间用逗号隔开
                //int[] shuzu=new int[]{1,2,3,4,5};

               // 练习,输入班级人数,将班级内所有人员姓名放进去
                   // 最后输出3号,4号索引人的姓名
              
                Console.Write("请输入班级人数:");
                int a=int.Parse(Console.ReadLine());
                string[]name=new string[a];
                for(int i=0;i<a;i++)
                {
                    Console.Write("请输入第"+(i+1)+"个人名");
                    name[i]=Console.ReadLine();

                }
                Console.Write("一下是所有人名:");
                for(int i=0;i<a;i++)
                {
                    Console.Write(name[i]+" ");
                }
          
               Console.ReadLine();


            }
        }
    }

  • 相关阅读:
    dos
    admin package
    ant 调用系统环境变量
    idea6+tomcat5.5开发web程序
    VFloppy
    ant中classpath
    Velocity用户手册
    ant中 Tomcat的任务调用(包括deploy,undeploy,load,start,stop等)
    [转]aidl高级应用篇
    Android NDK开发环境安装(OK版)
  • 原文地址:https://www.cnblogs.com/jiang2538406936/p/5165564.html
Copyright © 2011-2022 走看看