摘要:using System; using System.Threading; using System.Threading.Tasks; namespace AsyncAwaitDemo { class Program { static void Main(string[] args) { Conso
阅读全文
随笔分类 - C#
摘要:代码参考1: using System; using System.Linq.Expressions; namespace ExpressionDemo { class People { public int Id { set; get; } public string Name { set; ge
阅读全文
摘要:代码参考: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsCircleArea.
阅读全文
摘要:协变参考代码1: using System; using System.Collections.Generic; using System.Linq; namespace CovarianceSoOnDemo2 { public class Pet { protected bool _bPutOn;
阅读全文
摘要:参考代码1: using System;using System.Collections.Generic;using System.Linq;namespace FuncActionDemo{ class FuncActionTest { public void Test1(List<int> da
阅读全文
摘要:参考代码1: using System; namespace DelegateDemo { class Program { public delegate void Expresser(); static void Main(string[] args) { //委托, delegate Test
阅读全文
摘要:基本版: using System; namespace EventDemo1 { public delegate void CatCallEventHandler(); public class Cat { //定义猫叫事件 public event CatCallEventHandler Cat
阅读全文
摘要:参考代码: using System; namespace IndexerDemo { class StuInfo { public string Name; public string[] CouNameArray = new string[3]; public decimal[] CouSocr
阅读全文
摘要:汇总如下: using System; using System.Collections; using System.Linq; namespace SortDemo { public class MySort2 : IComparer { public int Compare(object x,
阅读全文
摘要:代码参考: using System; using System.Linq; namespace SliceDemo { class Program { static void Main(string[] args) { var myArray = new string[] { "10", "20"
阅读全文
摘要:用C# 或Python语言,编写控制台应用程序,实现下面的需求: 作业1: 用户从键盘输入数据,如果不是数据,显示“输入数据格式错误”。若为负数,屏幕显示“负数”,若为正数,屏幕显示为“正数”,若为零,显示为“零”。 作业2: 用户从键盘输入两个整数数据,比如:m和n,最后打印出一个m行n列矩形数字
阅读全文
摘要:代码1: using System; using System.Collections.Generic; using System.Linq; namespace LinqDistinctDemo { public class Person { public string Name { get; s
阅读全文
摘要:场景: [西安航天技师学院]实训中心某工件的加工过程,有两道主要工序,ProcessA,ProcessB。工序的数量及顺序一般情况下是固定的,车间的调度员 ProcessDirector负责调度,本次任务,打算安排三台精度不同的设备 ProductBuilder1、ProductBuilder2、P
阅读全文
摘要:场景: [陕西航天职工大学] 每学期都要根据各科成绩及其它表现评选出部分 三好学生奖、单科成绩优秀奖,思想品德优秀奖等各种奖项。 三好学生评奖主要条件:学习成绩各科平均成绩80分以上,且单科成绩不低于70分;道德表现良好(>=80),包括学年内无旷课,因私事假不超过三天,病假缺勤不超过总课时的5%等
阅读全文
摘要:第一种情况:依赖与关联,双向存在 UML类图: 代码参考: using System; namespace InterdependDemo { class SchoolInfo { private StudentInfo studentInfo; private TeacherInfo teache
阅读全文
摘要:1.数字字面量的改进 数字分割符:int million=1_000_000; 二进制使用0b前缀:var b=0b1010_1011 2.输出变量及参数忽略 bool successful=int.TryParse("123",out int result); Console.WriteLine(
阅读全文
浙公网安备 33010602011771号