欢迎来到萧静默的博客

书山有路勤为径,学海无涯苦作舟。

随笔分类 -  C#

摘要:using System; using System.Collections.Generic; using System.Text; namespace test { class Program { static void Main(string[] args) { Date birthday = 阅读全文
posted @ 2019-11-12 14:55 萧静默 阅读(536) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.Text; namespace test { class Program { static void Main(string[] args) { Time test1 = new 阅读全文
posted @ 2019-11-12 14:32 萧静默 阅读(853) 评论(0) 推荐(1)
摘要:using System; namespace test { class Program { static void Main(string[] args) { Cat kitty = new Cat(); // 无参构造函数 Cat1 KITTY = new Cat1("KITTY", 4); C 阅读全文
posted @ 2019-11-11 16:42 萧静默 阅读(651) 评论(0) 推荐(0)
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { Console.Write("你要输入多少项?"); int a = Convert.ToInt32(Console.Rea 阅读全文
posted @ 2019-11-08 15:52 萧静默 阅读(621) 评论(0) 推荐(0)
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { int b = j1(5); Console.WriteLine(b); int a = j(5); Console.Wri 阅读全文
posted @ 2019-11-08 14:39 萧静默 阅读(539) 评论(0) 推荐(0)
摘要:using System; namespace class1 { class program { static void Main(string[] args) { Console.Write("请输入a="); double a = double.Parse(Console.ReadLine()) 阅读全文
posted @ 2019-11-08 11:22 萧静默 阅读(588) 评论(0) 推荐(0)
摘要:using System; namespace class1 { class program { static void Main(string[] args) { //值传递引用,实际参数不会变化 Console.Write("请输入a="); double a = double.Parse(Co 阅读全文
posted @ 2019-11-08 10:30 萧静默 阅读(3401) 评论(0) 推荐(0)
摘要:using System; namespace class1 { class program { static void Main(string[] args) { int[][] arry = new int[2][];//这里的行必须定义好,但是列可以不定义好 arry[0] = new int 阅读全文
posted @ 2019-11-07 17:17 萧静默 阅读(1510) 评论(3) 推荐(0)
摘要:using System; namespace ConsoleApp3 { struct WuGong { public string Name; public int Attack; } class Program { static void Main(string[] args) { WuGon 阅读全文
posted @ 2019-11-07 15:12 萧静默 阅读(870) 评论(0) 推荐(0)
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { int[] a = { 1, 2, 3, 4, 5, 6 };//省略的数组声明方法 for (int i = 0; i < 阅读全文
posted @ 2019-11-06 16:50 萧静默 阅读(189) 评论(0) 推荐(0)
摘要:using System; namespace program { enum WeekDays { a,//0 b,//1 c = 11,//11 赋值以后就变成11,不赋值就是2 d,//12 e,//13 f,//14 g//15 }//不能输入数字 struct student { publi 阅读全文
posted @ 2019-11-06 14:42 萧静默 阅读(466) 评论(0) 推荐(0)
摘要:using System; namespace program { class program1 { static void Main(string[] args) { int a = 100; int b = 100; Console.WriteLine("下面使用竖式计算结果"); Consol 阅读全文
posted @ 2019-11-05 15:51 萧静默 阅读(447) 评论(0) 推荐(0)
摘要:using System; namespace program { class program1 { static void Main(string[] args) { program1 fenshu = new program1(); fenshu.Panduan(); program1 tian 阅读全文
posted @ 2019-11-04 15:29 萧静默 阅读(844) 评论(0) 推荐(0)
摘要:using System; namespace program { class program1 { static void Main(string[] args) { int a = 4, b = 5, c = 6; int p = (a + b + c) / 2; doub... 阅读全文
posted @ 2019-11-01 14:33 萧静默 阅读(256) 评论(0) 推荐(0)
摘要:using System; namespace HELLO { class Program { int week; int y, m, d; static void Main(string[] args) { int y, m, d; Console.WriteLine("请输入年月日"); Console.WriteLine("现在请输入年份"); y = int.Parse(Console.R 阅读全文
posted @ 2019-10-31 17:41 萧静默 阅读(719) 评论(2) 推荐(0)
摘要:【知识梳理】 - 类是一个抽象的存在,就像工业生产中的图纸一样 - 构造函数是一个类的初始化过程 【课堂要求】 - 大致了解类的概念 - 了解构造函数的作用 阅读全文
posted @ 2019-10-25 17:26 萧静默 阅读(153) 评论(0) 推荐(0)
摘要:可以使用两种方法: 阅读全文
posted @ 2019-10-25 16:22 萧静默 阅读(229) 评论(0) 推荐(0)
摘要:using System; namespace 排序案例 { class Program { static void Main(string[] args) { //定义随机数列 int a, b, c, d; Random rand = new Random(); ... 阅读全文
posted @ 2019-10-15 11:58 萧静默 阅读(306) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/a980433875/article/details/12231673 Visual Studio 中有很多代码段都可以直接简写然后按TAB快速输入编译器中,为了提高编程效率,特此查阅资料,罗列总结。 1. ~ 创建析构函数 ~Program() { 阅读全文
posted @ 2019-10-01 11:33 萧静默 阅读(5830) 评论(0) 推荐(0)
摘要:一、封装 隐藏对象的属性和实现细节,仅对外公开接口,控制在程序中属性的读取和修改的访问级别。 简单来多,就是讲我们所需要的代码打包封装进入一个类里面,便于我们调用,操作。这就是封装。 这样就隔离了具体的变化,便于使用,提高了复用性和安全性。 二、继承 继承可以使得子类具有父类的属性和方法或者重新定义 阅读全文
posted @ 2019-09-19 17:13 萧静默 阅读(771) 评论(0) 推荐(0)