zoukankan      html  css  js  c++  java
  • 结构体

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

  • 相关阅读:
    java 集合排序
    java传值和传址
    Dom4j操作xml
    JAXP操作xml
    乐观锁和悲观锁【转】
    java IO【转】
    java 可变参数
    Eclipse调试Java的10个技巧【转】
    编译JDK源代码【转】
    Access restriction: The method typeNameToClass(String) from the type ObjectHandler is not accessible due to restriction on required library
  • 原文地址:https://www.cnblogs.com/yx1314520/p/5734791.html
Copyright © 2011-2022 走看看