八皇后問題: 八個皇后在排列時不能同在一行、一列或一條斜線上。在8!=40320種排列中共有92種解決方案 using System;using System.Collections.Generic;using System.Text;namespace ExQueen{ class Queen { public void QueenArithmetic(int size) { int[] Queen = new int[size];
using System;using System.Collections.Generic;using System.Text;namespace ExArrange{ class Arrange { public void Arrange(int n, int r) { int i = 0, j; string s; int[] a = new int[n];
猴子選大王問題: 一堆猴子都有編號,編號是1,2,3 ...m ,這群猴子(m個)按照1到m的順序圍坐一圈,從第1開始數,每數到第n個,該猴子就要離開此圈,這樣依次下來,直到圈中只剩下最後一隻猴子,則該猴子為大王using System;using System.Collections.Generic;using System.Text;namespace ExMonkey{ class Monkey { public int King(int M, int N)
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ExDtoB{ public partial class Form1 : Form { public Form1() {
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ExToD{ public partial class Form1 : Form { public Form1() {
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace ExToD{ public partial class Form1 : Form { public Form1() {
'GNU cflow' analyzes a collection of C source files and prints a graph charting control flow within the program. It can produce both direct and inverted flowgraphs for C sources, or optionally generate a cross-reference listing. It implements either
1. 避免將多個類放在一個檔案裡面。2.一個檔案應該只有一個命名空間,避免將多個命名空間放在同一個檔案裡面。3.一個檔案最好不要超過500行的代碼(不包括機器產生的代碼)。4. 一個方法的代碼長度最好不要超過25行。5.避免方法中有超過5個參數的情況。使用結構來傳遞多個參數。6. 每行代碼不要超過80個字元。7. 不要手工的修改機器產生的代碼。a)如果需要編輯機器產生的代碼,編輯格式和風格要符合該編碼通訊協定。b) Use partial classes whenever possible
1. 在Outlook裡面鍵入ALT+F11開啟VBA編輯器;2、鍵入CTRL+R啟用左邊的那個工程面板,展開並雙擊上面的“Project (VbaProject.OTM)\Microsoft Office Outlook 對象\ThisOutlookSession”;3、將下面的代碼粘貼到右邊開啟的編輯區裡面去:Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim objRecip As
前段時間看了一些關於GC的論文、書和源碼。源碼指的是Boehm的保守GC ,論文也主要是圍繞這個GC相關的演算法,另外還包括一些survey和效能分析的論文。而其他關於GC的一些東西主要是從其他兩本書上看來,一本是謝之易老大翻譯的垃圾收集 ,目前唯一一本關於GC演算法的書,還有就是仔細閱讀了C# via CLR 中關於.net GC的部分。原本想做個GC演算法上的總結,但前幾天在實驗室做了個關於GC in C++的介紹,發現其他的一些關於GC的基本問題比演算法更需要好好分析。關於GC in C+