上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页
摘要: static void Main(string[] arg) { //日期时间的格式化 /*练习: 获取系统的当前日期时间,然后使用格式规范D将日期时间格式化为“YYYY年MM月dd日”的格式,代码如下*/ DateTime dt = DateTime.Now; string str1 = stri 阅读全文
posted @ 2024-08-17 12:52 CSF践行 阅读(26) 评论(0) 推荐(0)
摘要: static void Main(string[] arg) { /*数值类型的格式化*/ //输出金额 Console.WriteLine("今天我赚了{0:C}元", 120); //输出科学计数法 Console.WriteLine("12000.1用科学计数法表示是{0:E};", 1200 阅读全文
posted @ 2024-08-16 18:01 CSF践行 阅读(21) 评论(0) 推荐(0)
摘要: static void Main(string[] arg) { int int1 = 0; int int2 = 0; int int3 = 0; string str1 = "adf"; string str2 = "adf"; string str3 = "Adf"; string str4 阅读全文
posted @ 2024-08-16 17:33 CSF践行 阅读(46) 评论(0) 推荐(0)
摘要: static void Main(string[] arg) { int intSum = 0; for (int i = 0; i <= 100; i++) { intSum += i; } Console.WriteLine(intSum); Console.ReadKey(); } stati 阅读全文
posted @ 2024-08-12 12:28 CSF践行 阅读(23) 评论(0) 推荐(0)
摘要: static void Main(string[] arg) { //while的3个练习 Console.WriteLine("请输入班级人数:"); int intNum = 0; while (!(int.TryParse(Console.ReadLine(), out intNum))) { 阅读全文
posted @ 2024-08-12 10:40 CSF践行 阅读(33) 评论(0) 推荐(0)
摘要: //输入任意年份,月份,判断该月份天数; static void Main(string[] args) { int intDay = 0; int intYear = 0; int intMonth = 0; //任意输入年份和月份, 判断该月有几天; try { Console.WriteLin 阅读全文
posted @ 2024-08-11 21:57 CSF践行 阅读(23) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { double intSalary = 5000; bool bFlag = true; Console.WriteLine("请输入张三的评点等级:"); string strLevel = Console.ReadLine(); 阅读全文
posted @ 2024-08-11 17:27 CSF践行 阅读(23) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { string strUsrName = ""; string strPwd = ""; Console.WriteLine("please input your UsrName:"); strUsrName = Console.Re 阅读全文
posted @ 2024-08-11 12:42 CSF践行 阅读(32) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { int intNum = 0; bool bFlag = true; Console.WriteLine("请输入一个数字:"); try { intNum = Convert.ToInt32(Console.ReadLine()) 阅读全文
posted @ 2024-08-11 12:20 CSF践行 阅读(15) 评论(0) 推荐(0)
摘要: //比较运算符: // > // < // == // >= // <= // != //逻辑运算符 与&& 或|| 非! static void Main(string[] args) { while (true) { Console.WriteLine("请输入年份:"); int year = 阅读全文
posted @ 2024-08-10 17:16 CSF践行 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页