C#2022/11/7

  //int[] array = { 5, 5, 4, 6, 9, 8, 3 };          //foreach遍历;
            //foreach (var item in array)
            //{
            //    Console.Write(item);
            //}

            //Console.WriteLine("T1:DRX");
            //Console.WriteLine(new Program().T1_DRX());        //返回值不为空的方法;
            //Program program = new Program();                  //加减乘除;
            //Console.WriteLine(program.Add(9, 1));
            //Console.WriteLine(program.Subtraction(9,1));
            //Console.WriteLine(program.Multiplication(9,1));
            //Console.WriteLine(program.Division(9,1));

            //Circle circle = new Circle(10);                     //圆类的周长和面积;
            //circle.Circumference();
            //circle.S();

            //Calculate calculate = new Calculate();           //加减乘除取余开方平方;
            //Console.WriteLine(calculate.Add(9,2));
            //Console.WriteLine(calculate.Subtraction(9,2));
            //Console.WriteLine(calculate.Multiplication(9,2));
            //Console.WriteLine(calculate.Division(9,2));
            //Console.WriteLine(calculate.Surplus(9,2));
            //Console.WriteLine(calculate.Square(9,2));
            //Console.WriteLine(calculate.Open_square(9,2));

            //Console.WriteLine(func(5));                           //递归;

            //display(5);                                      //参数化函数输出N遍

            //Dog dog = new Dog("Buck",10,1);                    //覆写;
            //dog.Eat();
            //dog.Swim();
            //dog.Fly();

            //func(5, 2, 3);                                     //b的平方-4ac

            //Student student = new Student("showmaker",21,"DK","重铸LCK荣光");  //学员类输出相关信息;
            //student.display();

            //Hero hero = new Hero(60,"ironman");               //Hero类;
            //hero.go();
            //hero.hurt();
            //hero.hurt();
            //hero.hurt();
            //hero.hurt();
            //hero.hurt();
            //hero.hurt();
            //hero.hurt();
            //hero.eat(1);
            //hero.go();
            //hero.eat(100);

  //public float T1_DRX()
        //{
        //    return 2.3f;
        //}
        //public float Add(float f, float f1)                     //返回值_加减乘除;
        //{
        //    return f + f1;
        //}
        //public float Subtraction(float f, float f1)
        //{
        //    return f - f1;
        //}
        //public float Multiplication(float f, float f1)
        //{
        //    return f * f1;
        //}
        //public float Division(float f, float f1)
        //{
        //    return f / f1;
        //}

 //public static int func(int i)
        //{
        //    if (i == 1)
        //    {
        //        return 1;
        //    }
        //    return  i+func(i - 1);
        //}

//public static void display(int i)
        //{
        //    for (int j = 0; j < i; j++)
        //    {
        //        Console.WriteLine("Hello,World");
        //    }
        //}

 //public static void func(int a,int b,int c)
        //{
        //    if ((b*b-4*a*c)>0)
        //    {
        //        Console.WriteLine((-b + Math.Sqrt(b * b - 4 * a * c)) /(2 * a));
        //        Console.WriteLine((-b - Math.Sqrt(b * b - 4 * a * c)) /(2 * a));
        //    }
        //    else
        //    {
        //        Console.WriteLine("无根");
        //    }      
        //}

//class Circle
    //{
    //    private int r;
    //    public Circle(int r)
    //    {
    //        this.r = r;
    //    }
    //    public void Circumference()
    //    {
    //        Console.WriteLine("半径:{0}的圆的周长:{1}",r,3.14*r*2);
    //    }
    //    public void S()
    //    {
    //        Console.WriteLine("半径:{0}的圆的面积:{1}", r, 3.14 * r * r);
    //    }
    //}

 //class Calculate
    //{

    //    public double Add(double d1,double d2)                     //返回值_加减乘除;
    //    {
    //        return d1 + d2;
    //    }
    //    public double Subtraction(double d1,double d2)
    //    {
    //        return d1 - d2;
    //    }
    //    public double Multiplication(double d1,double d2)
    //    {
    //        return d1 * d2;
    //    }
    //    public double Division(double d1,double d2)
    //    {
    //        return d1 / d2;
    //    }
    //    public double Surplus(double d1,double d2)
    //    {
    //        return Math.Pow(d1, d2);
    //    }
    //    public double Square(double d1,double d2)
    //    {
    //        return d1 % d2;
    //    }
    //    public double Open_square(double d1,double d2)
    //    {
    //        return Math.Pow(d1, 1 / d2);
    //    }

    //}

 //class Student
    //{
    //    private string name;
    //    private int age;
    //    private string team;
    //    private string hobby;
    //    public Student(string name, int age, string team, string hobby)
    //    {
    //        this.name = name;
    //        this.age = age;
    //        this.team = team;
    //        this.hobby = hobby;
    //    }
    //    public void display()
    //    {
    //        Console.WriteLine("姓名:"+name);
    //        Console.WriteLine("年龄:"+age);
    //        Console.WriteLine("队伍:"+team);
    //        Console.WriteLine("爱好:"+hobby);
    //    }
    //}

 //class Hero
    //{
    //    private int power=100;
    //    private string name;
    //    public Hero(int power,string name)
    //    {
    //        this.power = power;
    //        this.name = name;
    //    }
    //    public void go()
    //    {
    //        if (power==0)
    //        {
    //            Console.WriteLine("不能行走,此英雄已死亡");
    //        }
    //        else
    //        {
    //            Console.WriteLine("前进");
    //        }
    //    }
    //    public void eat(int i)
    //    {
    //        if (power<=100-i)
    //        {
    //            power += i;
    //        }
    //        else
    //        {
    //            Console.WriteLine("体力溢出");
    //            power += (100 - power);
    //        }
    //    }
    //    public void hurt()
    //    {
    //        if (power>=10&&power<=100)
    //        {
    //            power -= 10;
    //        }
    //        else
    //        {
    //            Console.WriteLine("此英雄已死亡,无体力");
    //        }

    //    }
    //}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值