上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页
摘要: //StringBuilder的定义及相关操作 int int1 = 100; StringBuilder str1 = new StringBuilder("哈哈哈,", 100); str1.Append("你变了"); //Append函数 Console.WriteLine(str1); s 阅读全文
posted @ 2024-08-18 18:19 CSF践行 阅读(6) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { //截取字符串 string str1 = "ABCDEFGHIJKLMN"; string str2 = str1.Substring(0, 4);//从0位开始截取,共截取4位; Console.WriteLine(str2); 阅读全文
posted @ 2024-08-18 17:29 CSF践行 阅读(10) 评论(0) 推荐(0)
摘要: static void Main(string[] arg) { //日期时间的格式化 /*练习: 获取系统的当前日期时间,然后使用格式规范D将日期时间格式化为“YYYY年MM月dd日”的格式,代码如下*/ DateTime dt = DateTime.Now; string str1 = stri 阅读全文
posted @ 2024-08-17 12:52 CSF践行 阅读(20) 评论(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践行 阅读(14) 评论(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践行 阅读(34) 评论(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践行 阅读(17) 评论(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践行 阅读(26) 评论(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践行 阅读(18) 评论(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践行 阅读(15) 评论(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践行 阅读(14) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页