摘要: class Program { static void Main(string[] args) { #region 6、求一个数的偶数位的乘积(个位、百位、万位、百万位 等等 注:不允许操作字符串)。 // 个位、十位、百位、千位、万位、十万位、百万位 float num = 0; while (true) { Console.WriteLin... 阅读全文
posted @ 2013-10-10 10:58 LifeForCodes 阅读(204) 评论(0) 推荐(0) 编辑
摘要: #region 解决方案一 //思路:把所有的位置的值都标为1,,循环判断是3的倍数的位置的值标为2 Console.WriteLine("请输入人数:"); int number = int.Parse(Console.ReadLine()); List lastThree = new List(); int lastResult = 0; int[] intArr = new int[number]; for (int i = 0; i ... 阅读全文
posted @ 2013-10-10 10:42 LifeForCodes 阅读(461) 评论(0) 推荐(0) 编辑
摘要: *记得更改下方Panel的属性 public partial class Form2 : Form { public Form2() { InitializeComponent(); } Button btn = null; private void button1_MouseDown(object sender, MouseEventArgs e) { } private void panel2_DragEnter(object sender, D... 阅读全文
posted @ 2013-09-05 16:24 LifeForCodes 阅读(468) 评论(0) 推荐(0) 编辑
摘要: #region 3、随机排序一维数组 int[] #region 方法1 int[] oldnum = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int[] newnum = new int[oldnum.Length]; Random ran = new Random(); List intlist = new List(); for (int i = 0; i newlist = new List(); ... 阅读全文
posted @ 2013-09-04 17:38 LifeForCodes 阅读(257) 评论(0) 推荐(0) 编辑
摘要: #region 2、用一层循环打印九九乘法口诀。 #region 方法1 for (int i = 1; i y) // continue; // Console.Write("{0}*{1}={2} ", x, y, x * y); // if (x == y) // Console.WriteLine(""); //} #endregion ... 阅读全文
posted @ 2013-09-04 17:35 LifeForCodes 阅读(289) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { #region 1、将一个整数分解质因数。 //例如:输入 //90, //打印出 //90=2*3*3*5 Console.WriteLine("请输入一个正整数(输入0结束):"); int num = int.Parse(Console.ReadLine()); int nu... 阅读全文
posted @ 2013-09-04 17:29 LifeForCodes 阅读(227) 评论(0) 推荐(0) 编辑