随笔分类 -  C#基础

摘要:namespace 刘老师双色球{ class Program { static void Main(string[] args) { int count = 0; Console.WriteLine("请输入你的双色球号码"); ArrayList Ual = new ArrayList(); f... 阅读全文
posted @ 2015-04-08 21:49 XCml 阅读(205) 评论(0) 推荐(0)
摘要:namespace 集合与特殊集合{ class Program { static void Main(string[] args) { ArrayList al = new ArrayList(); al.Add("李青"); al.Add("约里克"); al.Add("安妮"); al.Add... 阅读全文
posted @ 2015-04-08 21:48 XCml 阅读(221) 评论(0) 推荐(0)
摘要:namespace 集合习题练一练{ class Program { static void Main(string[] args) { Console.WriteLine("请输入你们班的人数:"); int n = Convert.ToInt32(Console.ReadLine()); Arr... 阅读全文
posted @ 2015-04-08 21:47 XCml 阅读(190) 评论(0) 推荐(0)
摘要:namespace 集合__双色球练一练{ class Program { static void Main(string[] args) { // while (true) // { // ArrayList al = new ArrayList(); // al.Add(1); al.Add(... 阅读全文
posted @ 2015-04-08 21:46 XCml 阅读(429) 评论(0) 推荐(0)
摘要:namespace 刘老师推箱子{ class Program { static int kkk1, kkk2; static void Main(string[] args) { int x = 1, y = 1, i = 0; int[, ,] dt = new int[2, 10, 10] ... 阅读全文
posted @ 2015-04-08 21:42 XCml 阅读(169) 评论(0) 推荐(0)
摘要:for (int i = 1; i <a.Length; i++){ for (int j = 1; j <=a.Length-i; j++) { if (a[j-1]<a[j])//位置交换 { temp=a[j-1]; a[j-1]=a[j]; a[j]=temp; } }} 阅读全文
posted @ 2015-04-06 00:08 XCml 阅读(109) 评论(0) 推荐(0)
摘要:namespace 自己琢磨推箱子{ class Program { static void Main(string[] args) { //定义一个地图 int x=2,y=1;//小人的位置 int temp = 0; int[,] map = new int[10, 10] { {1,1,... 阅读全文
posted @ 2015-04-05 23:51 XCml 阅读(205) 评论(0) 推荐(0)
摘要:namespace index{ class Program { static void Main(string[] args) { while (true) { string s = "abcdefghijklmn"; int i = s.IndexOf("f"); // i是f在字符串s中的位置... 阅读全文
posted @ 2015-04-02 21:11 XCml 阅读(208) 评论(0) 推荐(0)
摘要:namespace yyyy_MM_dd_hh_mm{ class Program { static void Main(string[] args) { while (true){ try { Console.WriteLine("请输入您的出生年月日"); DateTime dt = Conve... 阅读全文
posted @ 2015-04-02 20:39 XCml 阅读(864) 评论(0) 推荐(0)
摘要:namespace 随机生成验证码{ class Program { static void Main(string[] args) { while (true) { string s = "abcdefghijklmnopqrstuvwxyz"; string t = "李青用强力的回旋踢击退地方... 阅读全文
posted @ 2015-04-02 20:21 XCml 阅读(200) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { Console.WriteLine("请输入一段英文:"); string s = Console.ReadLine(); int x = s.Length; //x代表字符的长度 for (int ... 阅读全文
posted @ 2015-04-02 19:35 XCml 阅读(108) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { Console.WriteLine("请输入您的年份"); int x = Convert.ToInt32(Console.ReadLine()); try { DateTime y = Conve... 阅读全文
posted @ 2015-04-02 19:31 XCml 阅读(135) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { string a; Console.WriteLine("请输入您的邮箱地址:"); a = Console.ReadLine(); if (a.Contains("@")&&a.Contains(".com"))//这句话的意思是... 阅读全文
posted @ 2015-04-02 19:28 XCml 阅读(263) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { DateTime dt = DateTime.Now; Console.WriteLine(dt); DateTime nz = Convert.ToDateTime("2015-4-2 17:00"); //将nz的时间转换为电... 阅读全文
posted @ 2015-04-02 19:25 XCml 阅读(131) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { string s = ""; s = "★\n★★\n★★★\n★★★★\n★★★★★"; Console.WriteLine(s); Console.ReadLine(); } 阅读全文
posted @ 2015-04-02 19:21 XCml 阅读(139) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { int y = 2; //过一个村庄丢一半零一只,过了7个村庄还是2只,求原来几只 for (int i = 1; i <=7; i++) { y = (y + 1) * 2; } Console.WriteLine(y); Con... 阅读全文
posted @ 2015-04-02 19:20 XCml 阅读(112) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { /* string x; Console.WriteLine("请随便输入:"); x= Console.ReadLine(); x=x.Trim();//前边的空格和后面的空格都去掉 Consol... 阅读全文
posted @ 2015-04-02 19:18 XCml 阅读(96) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { int i=1; while (i<=100) { Console.WriteLine(i); i++; if (i==50) { Console.WriteLine("sdsa"); } c... 阅读全文
posted @ 2015-04-02 19:15 XCml 阅读(108) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { int n = 0; for (int x = 1; x*15 <=200; x++) {可能性*可能性*可能性=全部可能性,从中找出符合条件的就OK(if); for (int y = 1; y*3 <=200; y++) { f... 阅读全文
posted @ 2015-04-02 19:10 XCml 阅读(110) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { /*★ ★★ //最重要的就是找规律 i--行 ★★★ j--列 ★★★★ ★★★★★ */ /*string s = "★"; int n; Console.WriteLine("请输入一个数:... 阅读全文
posted @ 2015-04-02 19:08 XCml 阅读(212) 评论(0) 推荐(0)