zoukankan      html  css  js  c++  java
  • 结构体英雄联盟练一练

    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();
            }
        }
    }

  • 相关阅读:
    Windows系统安装mysql5.7*时mysql服务启动失败的解决方法
    安装MySQL出现 This application requires Visual Studio 2013 x64 Redistributable.Please install the Redistributable then run this installer again
    Fiddler抓包流程
    C#使用NPOI根据模板生成Word文件功能实现
    .NET nhibernate 添加新的表运行报is not mapped的问题
    二进制原码、反码、补码和位运算
    【英语】面试常用语整理
    【检测分割算法整理】
    【Leetcode方法比较】DP/滑窗/前缀和
    【Leetcode】数学系列
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4404209.html
Copyright © 2011-2022 走看看