//Car car = new Car(); //车名+行驶速度;
//car.Name = "AudiRs7";
//car.CurrentSpeed = 200;
//car.Name = "梅赛德斯奔驰";
//car.CurrentSpeed = 120;
//Student student1 = new Student(); //Student类比较体重;
//student1.Name = "showmaker";
//student1.Weight = 70;
//Student student2 = new Student();
//student2.Name = "scout";
//student2.Weight = 50;
//if (student1.Weight>student2.Weight)
//{
// Console.WriteLine("{0}比{1}重",student1.Name,student2.Name);
//}
//else
//{
// Console.WriteLine("{0}比{1}重", student2.Name, student1.Name );
//}
//savingBank saving = new savingBank(); //银行;
//Console.WriteLine("银行账号:" + saving.Id);
//Console.Write("输入新密码:");
//saving.Password = Console.ReadLine();
//Console.WriteLine("password:" + saving.Password+" ");
//saving.IncreaseRate = 0.1;
//Console.WriteLine("存款:" + saving.Balance);
//Console.WriteLine("存款利息" + saving.IncreaseRate);
//CreditBank credit = new CreditBank();
//Console.WriteLine("信用卡额度" + credit.CreditLimit);
//Console.WriteLine("信用卡利息:" + credit.CreditRate);
//Random random = new Random(); //游戏角色
//Magicer magicer = new Magicer();
//magicer.Level = random.Next(1,11);
//Console.WriteLine(magicer.attack());
//Soldier soldier = new Soldier();
//soldier.Atk = 100;
//Console.WriteLine(soldier.Atk);
//Rectangular rectangular = new Rectangular(9,6); //抽象类动态多态性(方法覆写);
//Square square = new Square(9);
//Ticket ticket = new Ticket(int.Parse(Console.ReadLine())); //运费
//Console.WriteLine("{0}公里的运费是:{1}",ticket.Distance,ticket.Price);
//FlyTiger flyTiger = new FlyTiger(); //接口
//flyTiger.fly();
//Student student = new Student(); //抽象类抽象属性只用创建空的访问器;派生类对访问器进行覆写并创建1相应属性;
//Console.WriteLine(student.Age);
//class Car
//{
// private string name;
// private int currentSpeed;
// public string Name
// {
// get { return name; }
// set { name = value; }
// }
// public int CurrentSpeed
// {
// get { return currentSpeed; }
// set { currentSpeed = value; display(); }
// }
// void display()
// {
// Console.WriteLine("{0}当前的行驶速度是{1}Km/h", name, currentSpeed);
// }
//}
//class Student
//{
// private string name;
// private int weight;
// public string Name
// {
// set { name = value; }
// get { return name; }
// }
// public int Weight
// {
// set { weight = value; }
// get { return weight; }
// }
//}
//class Bank
//{
// private long id = 6217888888888888888;
// private double balance = 9999999999;
// private string password;
// public double Balance { get => balance; }
// public string Password
// {
// get { return "******"; }
// set
// {
// bool b = true;
// while (b)
// {
// if (value.Length != 6)
// {
// Console.Write("不符合修改规则,重新输入:");
// value = Console.ReadLine();
// }
// else
// {
// password = value;
// b = false;
// }
// }
// }
// }
// public long Id { get => id; }
//}
//class savingBank : Bank
//{
// private long id = 6217111111111111111;
// private double increaseRate;
// public double IncreaseRate
// {
// get { return increaseRate; }
// set
// {
// if (value > 0 && value <= 0.1)
// {
// increaseRate = value;
// }
// }
// }
// public new long Id { get => id;}
//}
//class CreditBank:Bank
//{
// private long id = 6217333333333333333;
// private long creditLimit = 10000;
// private double creditRate = 0.25;
// public double CreditRate { get => creditRate; }
// public new long Id { get => id; }
// public long CreditLimit { get => creditLimit; }
//}
//class Magicer
//{
// private int level;
// public int Level
// {
// get { return level; }
// set
// {
// if (1 <= value && value <= 10)
// {
// level = value;
// }
// }
// }
// public int attack()
// {
// return level * 5;
// }
//}
//class Soldier
//{
// private int atk;
// public int Atk { get => atk; set => atk = value; }
// public int attack()
// {
// return Atk;
// }
//}
//abstract class Area
//{
// public abstract void S();
//}
//class Rectangular : Area
//{
// private int length;
// private int width;
// public Rectangular(int length, int width)
// {
// this.length = length;
// this.width = width;
// S();
// }
// public override void S()
// {
// Console.WriteLine("长:{0} 宽:{1}的长方形的面积:{2}",length,width,length*width);
// }
//}
//class Square:Area
//{
// private int length;
// public Square(int length)
// {
// this.length = length;
// S();
// }
// public override void S()
// {
// Console.WriteLine("边长:{0}的正方形的面积:{1}",length,length*length);
// }
//}
//interface Ifly
//{
// void fly();
//}
//interface Itiger:Ifly
//{
// void eat();
//}
//class FlyTiger : Itiger
//{
// public void eat()
// {
// Console.WriteLine("实现接口Itiger.eat()方法,猛虎王吃蓝毒兽");
// }
// public void fly()
// {
// Console.WriteLine("实现接口Itiger:Ifly Ifly.fly()方法,猛虎王能飞");
// }
//}
//class Ticket
//{
// private int distance;
// private float price;
// public int Distance { get => distance; }
// public float Price { get => price; }
// public Ticket(int distance)
// {
// this.distance = distance;
// if (distance<=100)
// {
// price = distance;
// Console.WriteLine("{0}公里的运费是:{1}",distance,price);
// }
// else if (101<=distance&&distance<=200)
// {
// price = distance * 9.5f;
// }
// else if (201<=distance&&distance<=300)
// {
// price = distance * 0.9f;
// }
// else
// {
// price = distance * 0.8f;
// }
// }
//}
//abstract class Person
//{
// public abstract string Name { get; set; }
// public abstract int Age { set; get; }
//}
//class Student : Person
//{
// private string name;
// private int age;
// public override string Name { get { return name; } set { name = value; } }
// public override int Age { get { return age;} set { age = value; } }
//}