c#字典
发布日期:2021-05-07 10:31:40 浏览次数:13 分类:原创文章

本文共 627 字,大约阅读时间需要 2 分钟。

namespace ConsoleApp1{       class Program    {           static unsafe void Main(string[] args)        {               Dictionary<string, Student> students = new Dictionary<string, Student>();            for(int i = 0; i < 100; i++)            {                   Student student = new Student();                student.Name = "s_" + i;                student.Score = 100;                students.Add(student.Name, student);            }            Student student1 = students["s_6"];            Console.WriteLine(student1.Name);        }    }    class Student    {           public string Name;        public int Score;    }}
上一篇:c# typeof
下一篇:c# 委托

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年04月07日 19时48分44秒