王云阳的作业

来源:互联网 发布:c语言编写计算器程序 编辑:程序博客网 时间:2024/04/26 02:03
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace _11._17
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string z; int t; int i=0;
            string []a=new string[6];
            a[0] = "杯子";a[1]="电脑";a[2]="电视";a[3]="手机";
            string mc=null;


            do
            {
               
                Console.WriteLine("请选择要执行的命令:");
                Console.WriteLine("1.查看\t2.添加\t3.删除");
                t = Convert.ToInt32(Console.ReadLine());
                if (t == 1)
                {
                    for ( i = 0; i < a.Length;i++ )
                    { Console.WriteLine(a[i]);
                    }
                   
                }else if(t==2)
                
                {
                    Console.WriteLine("请输入要添加的物品名称:");
                    mc = Console.ReadLine();
                    a[4] = mc;


                }
                else if (t == 3)
                {
                    Console.WriteLine("骆老师写不来");
                   
                }
                Console.WriteLine("需要继续吗?输入y继续输入其他返回");
                z =Console.ReadLine();
            } while (z =="y");
        }


    }
}
        
    

原创粉丝点击