会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
CSF践行
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
37
下一页
2024年8月17日
日期时间格式化
摘要: 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)
2024年8月16日
数值类型的格式化
摘要: 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)
2024年8月12日
for循环练习
摘要: 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)
while循环的3个练习
摘要: 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)
2024年8月11日
switch和try-catch综合练习
摘要: //输入任意年份,月份,判断该月份天数; 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)
switch_case练习
摘要: 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)
try_catch异常捕获
摘要: 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)
2024年8月10日
比较运算符和逻辑运算符
摘要: //比较运算符: // > // < // == // >= // <= // != //逻辑运算符 与&& 或|| 非! 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
下一页
公告