摘要: //穷举int m=0; for (int i = 1; i <=200/15; i++) { for (int j = 1; j <=200/3 ; j++) { for (int k = 1; k < 200/2; k++) { if (15*i+3*j+2*k==200) { Console.... 阅读全文
posted @ 2015-03-03 11:46 冷先生 阅读(174) 评论(0) 推荐(0)
摘要: //打印三角菱形Console.WriteLine("请输入一个数:"); int x = Convert.ToInt32(Console.ReadLine()); string s = ""; string t = "Δ"; // string p = "→_→"; for (int k = 0;... 阅读全文
posted @ 2015-03-03 11:10 冷先生 阅读(245) 评论(0) 推荐(0)
摘要: for (int j = 0; j 0) { x = x + y;//本月的成兔=上月的成兔+上月的小兔 y = z;//本月的小兔=上月的幼兔 z = x;//本月的幼兔=本月的成兔 } } t = x+y+z;//总兔对数 Console.WriteLine(m+"个月后,总共有"+t+"对兔... 阅读全文
posted @ 2015-03-03 08:55 冷先生 阅读(234) 评论(0) 推荐(0)
摘要: for (int i = 0; i <10; i++) { Console.Title = "一元二次方程程序"; double a, b, c, d, x1, x2; ... 阅读全文
posted @ 2015-03-02 18:41 冷先生 阅读(1490) 评论(0) 推荐(0)
摘要: Console.Title = "结婚例子"; bool a, b, c; string y; Console.WriteLine("有房?(Y/N)"); y = Console... 阅读全文
posted @ 2015-03-02 18:35 冷先生 阅读(184) 评论(0) 推荐(0)
摘要: /*输入利润I,输出奖金(if和switch都写了一个)奖金计算:超过1000000的部分提1%;超过600000不足1000000的部分提1.5%;超过400000不足600000的部分提3%;超过200000不足400000的部分提5%;超过100000不足200000的部分提7.5%;不足10... 阅读全文
posted @ 2015-03-02 18:31 冷先生 阅读(310) 评论(0) 推荐(0)
摘要: Console.Title = "加减乘除"; double x, y,z=0; string m; int n=0; Console.WriteLine("第一个数:"); x ... 阅读全文
posted @ 2015-03-02 18:06 冷先生 阅读(2206) 评论(0) 推荐(1)
摘要: int n, m = 0; Console.WriteLine("阶梯数"); n = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <=n; i++) ... 阅读全文
posted @ 2015-03-02 17:12 冷先生 阅读(310) 评论(0) 推荐(0)
摘要: int y, d, m; int m1 = 31, m2 = 28, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31, m8 = 31, m9 = 30, m10 = 31, m11 = 30, m12 = 31; ... 阅读全文
posted @ 2015-03-02 16:40 冷先生 阅读(732) 评论(0) 推荐(0)
摘要: Random t = new Random(); string x, y; int a = t.Next(0,3); int b = t.Next(0,3); ... 阅读全文
posted @ 2015-03-02 16:32 冷先生 阅读(466) 评论(0) 推荐(0)