//输入身份证号,截取生日,输出 //370303199003053330 //Console.Write("请输入身份证号:"); //string id = Console.ReadLine(); //if (id.Length == 18) //{ // string year = id.Su
分类:
其他好文 时间:
2016-03-12 17:13:33
阅读次数:
146
Random: Random ran=new Random();//初始化 int a=ran.Next(10); Console.WhiteLine(a); Console.ReadLine(); //随机出验证码,对照输入,判断是否正确; string s = "abcdefghijklmnop
分类:
其他好文 时间:
2016-03-12 13:03:51
阅读次数:
133
//练习:判断邮箱格式是否正确 //1.有且只能有一个@ //2.不能以@开头 //3.@之后至少有一个. //4.@和.不能靠在一起 //5.不能以.结尾 Console.Write("请输入您的邮箱账号"); string mail = Console.ReadLine(); bool a =
分类:
其他好文 时间:
2016-03-12 11:43:52
阅读次数:
157
int a = 10; if (a < 10) { a++; } if (a > 3) ; { a--; } Console.WriteLine(a); Console.ReadLine(); if(){} else{}若if成立,则不去走else若if不成立,则一定会走else int a = 1
分类:
其他好文 时间:
2016-03-12 09:13:33
阅读次数:
273
1 //输入年月日,判断格式是否正确,如果错误,请重输 2 3 //Console.Write("请输入年份:"); 4 //for (; ; ) 5 //{ 6 // int n = int.Parse(Console.ReadLine()); 7 // if (n >= 0 && n <= 99
分类:
其他好文 时间:
2016-03-12 09:05:23
阅读次数:
223
一、异常语句 try catch finally try ;保护执行里面的代码,若其中有一句有误,直接跳转到catch,不会管下面的内容 try { Console.Write("请输入一个整数"); int a=int.Parse(Console.ReadLine()); Comsole.Writ
分类:
其他好文 时间:
2016-03-11 23:54:58
阅读次数:
224
练习:判断邮箱格式是否正确1.有且只能有一个@2.不能以@开头3.@之后至少有一个.4.@和.不能靠在一起5.不能以.结尾 1 Console.Write("请输入邮箱地址:"); 2 string m = Console.ReadLine(); 3 if (m.IndexOf("@") == m.
分类:
其他好文 时间:
2016-03-11 23:40:36
阅读次数:
247
//try//保护执行里面的代码段,若其中一句错误,直接跳转到catch,不会管下面的内容 //{ // Console.WriteLine("请输入一个整数"); // int a = int.Parse(Console.ReadLine()); // Console.WriteLine("hel
分类:
其他好文 时间:
2016-03-11 22:29:02
阅读次数:
215
案例:输入年份,月份,日期,判断输入是否正确,若不正确,重新输入,直到输入正确格式。 1 Console.Write("请输入年份:"); 2 3 for (; ; ) 4 { 5 int y = int.Parse(Console.ReadLine()); 6 if (y >= 0 && y <=
分类:
编程语言 时间:
2016-03-11 22:25:51
阅读次数:
243
循环、类0311 1、棋盘放粮食/一天一分钱问题 Console.Write("输入天数:"); double a = double.Parse(Console.ReadLine()); double sum = 0, d = 0; for (double i = 1; i <= a; i++) {
分类:
其他好文 时间:
2016-03-11 22:18:44
阅读次数:
272