摘要: int a = 1; int b = 0; int c = 0; for (int i = 1; i <= 24; i++) { if (i == 1) ... 阅读全文
posted @ 2014-12-13 21:05 ヾBailey灬 阅读(323) 评论(0) 推荐(3)
摘要: int b = int.Parse(Console.ReadLine()); if (b % 4 == 0 && b % 100 != 0) { Console.WriteLine("是闰年"); } ... 阅读全文
posted @ 2014-12-13 21:05 ヾBailey灬 阅读(105) 评论(0) 推荐(3)
摘要: for (int i = 0; i < 100; i++) { Console.WriteLine("hello world {0}", i); } Console.ReadLine(); 阅读全文
posted @ 2014-12-13 21:04 ヾBailey灬 阅读(108) 评论(0) 推荐(3)
摘要: for (int a = 1; a <= 50; a++) { for (int b = 1; b <= 20; b++) { if (2 * a ... 阅读全文
posted @ 2014-12-13 21:03 ヾBailey灬 阅读(138) 评论(0) 推荐(3)
摘要: String b=Console.ReadLine();int a=int.Parse(b);string s=(a>=1&&a=7&&a<=12)?("下半年"):("请输入正确的日期"));Console.WriteLine(s);Console.ReadLine(); 阅读全文
posted @ 2014-12-13 21:02 ヾBailey灬 阅读(379) 评论(0) 推荐(3)
摘要: 输入一个年月日,判断是这一年的第几天?Console.WriteLine("请输入年:");int year = int.Parse(Console.ReadLine());Console.WriteLine("请输入月:");int month = int.Parse(Console.ReadLi... 阅读全文
posted @ 2014-12-11 20:51 ヾBailey灬 阅读(288) 评论(0) 推荐(3)
摘要: //switch caseint i=int.Parse(Console.ReadLine());switch(i){case 1:console.WriteLine("星期一");break;case 2:console.WriteLine("星期二");break;case 3:console.... 阅读全文
posted @ 2014-12-11 20:50 ヾBailey灬 阅读(139) 评论(0) 推荐(2)
摘要: ---值类型:int : 表示整数 ,是一个值类型,有符号32位整数。bool:真假值,用来存储布尔值true和false。Sbyte:用来表示整数,有符号的8位整数Byte:0-255,无符号整数Decimal:双精度浮点数,用来表示小数。Double:用来表示小数。模糊Float:表示小数,小数... 阅读全文
posted @ 2014-12-11 20:48 ヾBailey灬 阅读(205) 评论(0) 推荐(2)
摘要: 类型转换:int i=4;int s=5;double jieguo=(double)i/s; (在变量前直接加小括号转换为强制转换,只能为double,int,decimal)string ss=i.ToString(); (将 i 转化为string类型)string s1="3.5";doub... 阅读全文
posted @ 2014-12-11 20:22 ヾBailey灬 阅读(119) 评论(0) 推荐(2)
摘要: //递增运算符c=a++ //"a++"等于“a=a+1”,先执行C的操作,再执行 a 的操作c=++a //先执行++a操作,再执行c的操作前++的运算优先级在加减乘除模之上//比较运算符 >,=, b;Console.WriteLine(bo);比较运算符的优先级在数学运算符之下//条件运算符(... 阅读全文
posted @ 2014-12-11 20:21 ヾBailey灬 阅读(159) 评论(0) 推荐(2)