TOI-M5 第1,2,4題的自訂資料
TOI-M5 第3題的自訂資料
zerojudge已建題:c199、c200、c201、c2...
2017年5月29日 星期一
2017年5月22日 星期一
b547 巧克力口味
/*
b547-巧克力口味
*/
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
const int MaxR = 10;
set <string> rel[MaxR]; // 最多 10 種 關係
map <int , int> c2n;
string rs(8,'?');
string c6(6,' ');
int getn(int...
2017年5月21日 星期日
2017年5月20日 星期六
2017年5月2日 星期二
Z2A,Z1A求組合數
4/28中午及5/1晚上加強,Z2A三位、Z1A三位,共6位到課
Vb2010 -Windows Form專案: 四個按鈕、二個文字方塊(輸入m,n),一個標籤(輸出)
M取N求組合數(二項係數) 0<=N<=M<=66,分四種解法程式碼如下:
Dim c(66, 66) As Long '第4種解法使用
'解法一:呼叫函式 pk(k) 算出 k階乘 值, 0<=k<=66 ,但k=21 時溢位
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim m As...
Z2A河內塔範例
4/26中午加強,Z2A三位學生到課
Vb2010 -Windows Form專案: 一個按鈕、一個文字方塊,以debug.print輸出至即時運算視窗
程式碼如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Integer = TextBox1.Text
ho(n, "A", "B", "C")
End Sub
Sub ho(ByVal n As Integer, ByVal a As Char, ByVal b As...