• 结构体英雄联盟练一练


    namespace 结构体英雄联盟练一练
    {
        class Program
        {
            struct player
            {
                public string name;
                public int dengji;
                public zy z;
                public zb cz;
            }
            struct zy
            {
                public int ll;
                public int zh;
                public int mj;
                public int fy;
            }
            struct zb
            {
                public string sx;
                public string wj;
                public string yx;
                public string ny;  
            }
            static void Main(string[] args)
            {
                player a = new player();
                a.name = "李青";
                a.dengji = 1;
                a.z.ll = 50;
                a.z.zh = 30;
                a.z.mj = 100;
                a.z.fy = 43;
                a.cz.sx = "三项之力";
                a.cz.wj = "无尽之刃";
                a.cz.yx = "饮血剑";
                a.cz.ny = "女妖面纱";
              
                player b = new player();
                b.name = "亚索";
                b.dengji = 1;
                b.z.ll = 100;
                b.z.zh = 15;
                b.z.mj = 100;
                b.z.fy = 43;
                b.cz.sx = "斯塔缇克电刃";
                b.cz.wj = "无尽之刃";
                b.cz.yx = "破败王者之刃";
                b.cz.ny = "春哥甲";

                Console.WriteLine("英雄名称:"+a.name+" 等级:"+a.dengji+" 力量:"+a.z.ll+" 智慧:"+a.z.zh+" 敏捷:"+a.z.mj+" 防御:"+a.z.fy+" 装备:"+(a.cz.sx+" "+a.cz.wj+" "+a.cz.yx+" "+a.cz.ny));
                Console.WriteLine();  
                Console.WriteLine("英雄名称:" + b.name + " 等级:" + b.dengji + " 力量:" + b.z.ll + " 智慧:" + b.z.zh + " 敏捷:" + b.z.mj + " 防御:" +b.z.fy+ " 装备:" + (b.cz.sx + " " + b.cz.wj + " " + b.cz.yx + " " + b.cz.ny));
               
                //下面开始计算伤害
                //气血=默认值+力量*等级*1+防御*等级*2
                //能量=默认值+智慧*等级*2+敏捷*等级
                int qx = 200 + a.z.ll * a.dengji * 1 + a.z.fy *  a.dengji* 2;
                int nl =100 + a.z.zh * a.dengji * 1 + a.z.mj * a.dengji * 2;
                int qx1 = 200 + b.z.ll * b.dengji * 1 + b.z.fy * b.dengji * 2;
                int nl1 = 100 + b.z.zh * b.dengji * 1 + b.z.mj * b.dengji * 2;

                Console.WriteLine(a.name+"气血:"+qx+" 能量:"+nl+" "+b.name+"气血:"+qx1+" 能量:"+nl1);
               
               
               
               
                Console.ReadLine();
            }
        }
    }

  • 相关阅读:
    最新超详细VMware虚拟机安装完整教程
    Java网络编程 -- AIO异步网络编程
    Java网络编程 -- NIO非阻塞网络编程
    Java网络编程 -- BIO 阻塞式网络编程
    Java网络编程 -- 网络协议
    自定义FutureTask实现
    JDK容器类List,Set,Queue源码解读
    JDK容器类Map源码解读
    深入理解Java中的锁(三)
    深入理解Java中的锁(二)
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4404209.html
Copyright © 2020-2023  润新知