美文网首页
第十次作业第一题

第十次作业第一题

作者: 孤独是种安全感_b7bf | 来源:发表于2018-12-05 18:04 被阅读0次

    代码

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

    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {/**
    * 在控制台显示5件特价商品名称
    * (1) . 创建一个长度为5的String数组,存储商品名称。
    * (2) . 使用循环输出商品名称
    * */
    //声明数组
    string[] usernames;
    //边声明边赋值
    usernames = new string[]{"Nike背包","Adidas运动衫","李宁运动鞋","Kappa外套","361°腰包" };
    Console.WriteLine("本次活动特价商品有:");
    for (int i = 0; i < usernames.Length;i++ )
    {
    Console.WriteLine(usernames[i]);
    }
    Console.ReadKey();
    }
    }
    }

    效果

    IMG_20181205_150550.jpg

    相关文章

      网友评论

          本文标题:第十次作业第一题

          本文链接:https://www.haomeiwen.com/subject/pqqwcqtx.html