摘要: //比较运算符: // > // < // == // >= // <= // != //逻辑运算符 与&& 或|| 非! static void Main(string[] args) { while (true) { Console.WriteLine("请输入年份:"); int year = 阅读全文
posted @ 2024-08-10 17:16 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //五种复合运算符: // += // -= // *= // /= // %= double d1 = 0; double d2 = 0; d1 += 5; d1 = d1 + 5; d1 -= 5; d1 = d1 - 5; d 阅读全文
posted @ 2024-08-10 16:54 CSF践行 阅读(2) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //Convert转换:不同数据类型之间的转换; //大前提: 面儿上一定要过得去 Console.WriteLine("请输入你的姓名:"); string strName = Console.ReadLine(); Consol 阅读全文
posted @ 2024-08-10 15:16 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //自动转换的条件: //1)数据类型兼容;(int和double) //2)必须是小的类型转大的类型; int i = 23; double d = i; //强制转换: 结果:丢失精度 double pi = 3.1415; i 阅读全文
posted @ 2024-08-10 12:06 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //算术运算符: + - * / % //演示:某学生三门功课的成绩分别是: 语文85 数学 95 英语 75 求总分和平均分; double douChinese = 85; double douMath = 95; double 阅读全文
posted @ 2024-08-10 11:46 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { //🔺转义符的定义:'/'+特殊的字符组成特殊意义的字符;其中\表示转义, 不是字符; //(\")表示英文半角的(")字符; Console.WriteLine("今天天气好\"晴\"朗,处处好风光;");//其中\"表示字符" 阅读全文
posted @ 2024-08-10 10:57 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { Console.WriteLine("美女,你喜欢吃什么水果?"); string strFruit = Console.ReadLine();//接收用户输入的字符串; Console.WriteLine("这么巧吗,我也喜欢吃" 阅读全文
posted @ 2024-08-10 09:57 CSF践行 阅读(1) 评论(0) 推荐(0) 编辑