《零基础学C#》第五章-实例04:输出狼人杀游戏主要角色

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wtxhai/article/details/88420741
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Example504_01
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("狼人杀游戏的主要身份:");  //提示信息
            //定义数组,存储狼人杀游戏主要角色
            string[] roles = { "狼人", "预言家", "村民", "女巫", "丘比特", "猎人", "守卫" };
            foreach (string role in roles)     //遍历数组
            {
                Console.Write(role + "  ");    //输出遍历到的元素
            }
            Console.ReadLine();
        }
    }
}

猜你喜欢

转载自blog.csdn.net/wtxhai/article/details/88420741