• 结构体


    / struct Fenshu
    // {
    // public ArrayList al;
    // }

    // //结构体
    // struct Student
    // {
    // public int no;
    // public string name;
    // public string sex;
    // public Score fen;
    // }
    //结构体内部可以直接放置另一个结构体的数据类型
    //struct Score
    //{
    // public double yu;
    // public double shu;
    // public double ying;
    //}


    //enum student:int
    //{
    // one=2,
    // two=1,
    // three,
    // four=three
    //}

    //enum Weekday
    //{
    // Sunday,
    // Monday,
    // Tuesday,
    // Wendsday,
    // Thursday,
    // Friday,
    // Saturday
    //}

    //将结构体添加进集合中,取出当中的某一个进行所有信息的查看

    //三个候选班长,张三、李四、王五
    //20个人投票,1、2、3分别对应张三李四王五
    //其他的均视为废票
    //要求20个人输入的全部放进数组中,查看谁的票数最高
    //int[] array = new int[20];
    //for (int i = 0; i < 20;i++ )
    //{
    // Console.Write("请输入第"+(i+1)+"人的选票:");
    // array[i]=int.Parse(Console.ReadLine ());
    //}
    //int a = 0;
    //int b = 0;
    //int c = 0;
    //for (int i = 0; i < 20;i++ )
    //{
    // if(array[i]==1)
    // {
    // a++;
    // }
    // else if(array[i]==2)
    // {
    // b++;
    // }
    // else if (array[i] == 3)
    // {
    // c++;
    // }
    // else
    // {
    // Console.WriteLine("该票作废");
    // Console.ReadLine();
    // }
    //}
    //if(a>b&&a>c)
    //{
    // Console.WriteLine("选出的班长为张三");
    // Console.ReadLine();
    //}
    //if (b > a && b > c)
    //{
    // Console.WriteLine("选出的班长为李四");
    // Console.ReadLine();
    //}
    //if (c > b && c > a)
    //{
    // Console.WriteLine("选出的班长为王五");
    // Console.ReadLine();
    //}
    //if(a==b &&a>c || a==c&&a>b||b==c&&b>a)
    //{
    // Console.WriteLine("有两人得票相同且最高,请重新选票");
    // Console.ReadLine();
    //}
    //#region
    // Console.WriteLine((int)Weekday.Friday);
    //Console.ReadLine();

  • 相关阅读:
    全站导航
    常用模块
    模块的引用的路径的查找
    类的魔术方法
    包装和授权
    类内置的attr属性
    反射
    三大特性之多态
    三大特性之封装
    python应用:爬虫框架Scrapy系统学习第二篇——windows下安装scrapy
  • 原文地址:https://www.cnblogs.com/yx1314520/p/5734791.html
Copyright © 2020-2023  润新知