- 9月 27 週一 201019:20
試題02:試設計能應付 "商業用途" 的 "日期相關" 副程式 ;試題03:設計時 "不使用各月對照值",...
void date2days(unsigned long ws_date,unsigned long *ret_days, int *ret_week);
ws_mm = ws_mmdd / 100;
jj = yyyy / 4 + yyyy / 400 - yyyy / 100;
- 9月 24 週五 201004:08
btree.c == ISAM(Indexed Sequential Access Method) 的主程式
/* btree.c --- debug by Mike Wang --- */
/*
ISAM主程式約一千多行,
(Indexed Sequential Access Method)
/*
ISAM主程式約一千多行,
(Indexed Sequential Access Method)
- 9月 23 週四 201021:07
試題01: 試 "以最少比較次數" 印出 "大樂透(49個號碼取6個號碼)" 的所有可能開出的號碼(不含特別號)
/* 試題: C(49,6) ==> 試 "以最少比較次數" 印出 "大樂透(49個號碼取6個號碼)" 的所有可能開出的號碼(不含特別號) */
/* 以下共23行, 請修改下列有問號處?...... */
void main(int argc, char **argv)
{
long ll = 0L;
int i, j, nn[6]={1,2,3,4,5,6},kk[6]={1,2,3,4,5,6}, mm[6]={ ?,?,?,?,?,?};//C(49,6)
for(;;)
{
printf("<%d %d %d %d %d %d>\n",kk[0],kk[1],kk[2],kk[3],kk[4],kk[5]);
for(j=5;j>=1;j--)
{
if(kk[j]>mm[j])
{
?......;
?......;
?......;
}
}
?......;
if(kk[0]==mm[0])
break;
?......;
}
printf("<%ld>\n",ll);
}
/* 以下共23行, 請修改下列有問號處?...... */
void main(int argc, char **argv)
{
long ll = 0L;
int i, j, nn[6]={1,2,3,4,5,6},kk[6]={1,2,3,4,5,6}, mm[6]={ ?,?,?,?,?,?};//C(49,6)
for(;;)
{
printf("<%d %d %d %d %d %d>\n",kk[0],kk[1],kk[2],kk[3],kk[4],kk[5]);
for(j=5;j>=1;j--)
{
if(kk[j]>mm[j])
{
?......;
?......;
?......;
}
}
?......;
if(kk[0]==mm[0])
break;
?......;
}
printf("<%ld>\n",ll);
}
- 9月 23 週四 201020:58
dc.c (仿unix命令dc, 後置式計算機) ------ Mike Wang
/*
程式檔名 : dc.c (仿unix命令dc, 後置式計算機)
功能說明 : desk caculator
initial coding by Mike Wang
設 計 者 : (筆名)王駿(Mike Wang)
免費參考: This library is free software.
程式檔名 : dc.c (仿unix命令dc, 後置式計算機)
功能說明 : desk caculator
initial coding by Mike Wang
設 計 者 : (筆名)王駿(Mike Wang)
免費參考: This library is free software.
- 9月 23 週四 201020:50
expr.c (仿unix命令expr)
expr.c (仿unix命令expr)
/*
* Expression Abstract Syntax Tree Functions
*
* Copyright 2002 Ove Kaaven
* Copyright 2006-2008 Robert Shearman
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
/*
* Expression Abstract Syntax Tree Functions
*
* Copyright 2002 Ove Kaaven
* Copyright 2006-2008 Robert Shearman
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- 9月 23 週四 201020:33
grep.c (仿unix命令grep)
grep.c (仿unix命令grep) 約1697行, 48K
* grep 原本主要是在 unix/linux 下被用來找出 含/不含 某字串的工具,
而在DOS下也可找到相容的grep.exe
* 在Windows下使用grep.exe時, 請先進 "命令提示元" 環境下操作
* 例1: 找含字串 2010 的文字行 ==>
grep.exe 2010 input.txt > output.txt
* 例2: 找以 abc 開頭, 且末尾是 789 的文字行 ==>
grep.exe "^abc.*789$" input.txt > output.txt
註: ^ 表示後面的字在一行的開頭
. 表示任意字
* 表示前面的字出現任意次
$ 表示前面的字在一行的末尾
* 例3 :找不含 the 的文字行 ==>
grep.exe -v the input.txt > output.txt
而在DOS下也可找到相容的grep.exe
* 在Windows下使用grep.exe時, 請先進 "命令提示元" 環境下操作
* 例1: 找含字串 2010 的文字行 ==>
grep.exe 2010 input.txt > output.txt
* 例2: 找以 abc 開頭, 且末尾是 789 的文字行 ==>
grep.exe "^abc.*789$" input.txt > output.txt
註: ^ 表示後面的字在一行的開頭
. 表示任意字
* 表示前面的字出現任意次
$ 表示前面的字在一行的末尾
* 例3 :找不含 the 的文字行 ==>
grep.exe -v the input.txt > output.txt
1
