经典算法之冒泡排序c#public static int[] BubbleSort(int[] array){ int length = array.Length; for (int i = 0; i <= length - 1; i++) { for (int j = length - 1; j > i; j--)……继续阅读 » 水墨上仙 9年前 (2017-03-27) 3260浏览 1127个赞
C#实现窗体几种淡入淡出效果的方法1.private void Form1_Load(object sender, System.EventArgs e)for(double d=0.01; d< 1; d+=0.02) { System.Threading.Thread.Sleep(1); Application.DoEvents();……继续阅读 » 水墨上仙 9年前 (2017-03-27) 2242浏览 1087个赞
住在乌托邦首都(编号为1)的天凯,开始对首都的交通情况感到不满,因为,他发现首都到某些城市,即使他选择最短的路径,距离也非常远。因此他想让你求一下交通中心城市是哪座城市(也有可能就是首都)。 为了说明交通中心城市的概念,先定义G[i]为距离城市i最远的城市(到城市i的最短路径长度最长的城市)到城市i的距离。那么交通中心城市都是G[i]最小的城市,如果有几个城……继续阅读 » 水墨上仙 9年前 (2017-03-27) 1655浏览 2931个赞
排序算法之C#的堆排序示例代码private static void Adjust (int[] list, int i, int m){ int Temp = list[i]; int j = i * 2 + 1; while (j <= m) { //more children……继续阅读 » 水墨上仙 9年前 (2017-03-27) 2721浏览 910个赞
如果在C:\下执行下面的批处理代码,则返回 Current drive is C:@ECHO OFF:: CURDRIVE.BAT:: Written by Rob van der Woude:: Places the current drive letter in environment variable CURRDRIVE::S……继续阅读 » 水墨上仙 9年前 (2017-03-27) 2178浏览 1801个赞
使用前请先安装openpyxl:easy_install openpyxl通过这个模块可以很方便的导出数据到Excelfrom openpyxl.workbook import Workbookfrom openpyxl.writer.excel import ExcelWriterfrom openpyxl.cell import get_colu……继续阅读 » 水墨上仙 9年前 (2017-03-27) 2634浏览 2946个赞
foreach语句遍历数组C#的使用using System; public class w3demo { public static void Main() { int sum = 0; int[] nums = new int[10]; // give nums some values ……继续阅读 » 水墨上仙 9年前 (2017-03-27) 1870浏览 1537个赞
下面的代码演示了JS中如何通过数组对象的join方法将数组元素连接成一个字符串输出<!DOCTYPE html><html><body><p id="demo">Click the button to join the array elements into a str……继续阅读 » 水墨上仙 9年前 (2017-03-27) 1813浏览 2531个赞