C#中使用结构体+有参构造函数
来源:互联网 发布:wps苹果mac版下载软件 编辑:程序博客网 时间:2024/04/29 15:05
具体看代码吧:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace MyFirstApp{ public struct node { public string name; public int score; public node(string _name, int _score) { this.name = _name; this.score = _score; } } class Program { static void Main(string[] args) { node []a = new node[8]; a[0].name = "吴松"; a[0].score = 89; a[1].name = "钱东宇"; a[1].score = 90; a[2].name = "伏晨"; a[2].score = 98; a[3].name = "陈陆"; a[3].score = 56; a[4].name = "周蕊"; a[4].score = 60; a[5].name = "林日鹏"; a[5].score = 9; a[6].name = "何昆"; a[6].score = 93; a[7].name = "关欣"; a[7].score = 85; node tmp = new node("",0); for (int i = 0; i < 8; i++) { if (a[i].score > tmp.score) { tmp.score = a[i].score; tmp.name = a[i].name; } } Console.WriteLine("分数最高的是" + tmp.name + ",分数是" + tmp.score); } }}
0 0
- C#中使用结构体+有参构造函数
- 结构体中使用构造函数初始化
- c#的结构类型也可以有构造函数
- c#的结构类型也可以有构造函数
- C#基础篇 结构:在结构中定义构造函数
- C#中构造函数的使用
- java有参构造函数的使用
- C#中构造函数
- C#在子类中调用父类的有参构造函数
- C#高级编程学习笔记--------构造函数(层次结构中添加参数的构造函数)
- 【结构体】中构造函数初始化变量及函数的使用
- C#中继承带参构造函数
- C# 结构体的构造函数与初始化
- C++中struct也有构造函数与析构函数,也可以有访问类型控制以及结构体大小,类大小
- C#中静态构造函数
- C#中静态构造函数
- 结构体中使用函数
- C#的反射中使用带参的构造函数进行构建对象
- UE4命令行参数解析
- 获取系统时间
- flume学习(二):flume将log4j日志数据写入到hdfs
- 完全卸载oracle数据库
- Caffe实践
- C#中使用结构体+有参构造函数
- h5学习之5(html中常见标签的分类和标签之间的转换)
- Java GUI之Jbutton的重绘
- python基础知识整理
- Sicily---1039. Phone Home(图的最少染色)
- 小马哥---高仿苹果6s 机型版本M718 6571新旧版本机型识别对比图 10月后机型更换屏幕
- Ubuntu系统中切换python版本
- ajax的post提交参数长度超出限制的解决办法
- 1027. Colors in Mars (20)