摘要: 值类型 数据类型,字符类型,布尔类型,日期类型 结构类型(struct),枚举类型(enum) 引用类型 字符串(string),数组,类,委托类型 说明:(1)值类型数据-通常在栈(stack)中分配,变量中存放的是实际数据值。(2)引用类型的实际数据被分配在堆(managed heap)中,而引 阅读全文
posted @ 2021-01-10 23:09 默默依然 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Console.WriteLine("请输入要判断的年份"); int year = Convert.ToInt32(Console.ReadLine()); //年份能够被400整除。(2000) //年份能被4整除,但是不能被100整除。(2008) //逻辑与的优先级高于逻辑或,最好关系运算式 阅读全文
posted @ 2021-01-10 21:42 默默依然 阅读(1515) 评论(0) 推荐(0) 编辑
摘要: //编程实现107653秒是几天几小时几分钟几秒? Console.WriteLine("请输入所要计算的时间,单位为秒"); int seconds =int.Parse( Console.ReadLine()); //输入相应数值,转换为int类型 int day = seconds / (24 阅读全文
posted @ 2021-01-10 19:57 默默依然 阅读(825) 评论(0) 推荐(0) 编辑
摘要: 方法一 int n1 = 70; int n2 = 40; n1 = n1 + n2; //n1=110 n2 = n1 - n2; //n2=70 n1 = n1 - n2; //n1=40 Console.WriteLine($"第一个值是{n1},第二个值是{n2}"); 方法二 int n1 阅读全文
posted @ 2021-01-10 15:43 默默依然 阅读(70) 评论(0) 推荐(0) 编辑