• c#属性


     class Program
        {
           static void Main(string[] args)
            {
                ceshi wo;
               Student av = new Student();
               wo=new ceshi(av.Sum);
               ceshi wo1=new ceshi(av.Avg);
               
    
                av.Age = 20;
                av.Shuxue = 100;
                av.Yingyu = 150;
                av.Yuwen = 120;
                Console.WriteLine("总成绩为{0},
    平均值为{1}", wo(av.Shuxue, av.Yuwen, av.Yingyu), wo1(av.Shuxue, av.Yuwen, av.Yingyu));
                Console.ReadKey();
    
            }
     delegate double ceshi(double a, double b, double c);
        class Student
        {
            public double Sum(double a, double b, double c)
            {
    
                return a + b + c;
            }
            public double Avg(double a, double c, double b)
            {
    
                return (a + b + c) / 3;
            }
            private string name;
            private char sex;
            private int age;
            private double shuxue;
            private double yuwen;
            private double yingyu;
            
            public string Name {
                set {name = value;}
                get { return name; }
              }
            public int Age {
                set { age = value; }
                get { return age; }
            
            }
            public double Shuxue
            {
                set { shuxue = value; }
                get { return shuxue; }
    
            }
            public double Yingyu
            {
                set { yingyu = value; }
                get { return yingyu; }
    
            }
            public double Yuwen
            {
                set { yuwen = value; }
                get { return yuwen; }
    
            }
           
        
        }
        
  • 相关阅读:
    爬虫-requests-html
    pillow
    bs4-mysql-豌豆荚
    代理池-豆瓣电影
    Codeforces 1373D
    Codeforces 1365D
    AtCoder "NOMURA Programming Competition 2020" C
    Codeforces 1359D
    Codeforces 1359C
    Codeforces 1358D
  • 原文地址:https://www.cnblogs.com/mengluo/p/4796823.html
Copyright © 2020-2023  润新知