<?xml version="1.0" encoding="UTF-8"  standalone="yes" ?>
<rss version="2.0">
	<channel>
		<title>社群: AutoCAD開放式教學 - 文件區</title>
		<description>台灣數位學習數位教學平台 RSS feed provider</description>
		<language>zh-tw</language>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doclist&amp;folderID=</link>
	<item>
		<title>書上的 code of bubble- sort, 錯誤 ㄧ堆</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3907</link>
		<description>#if 0#endif// --------------------------------------------------------#include &amp;lt;time.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;stdio.h&amp;gt;// --------------------------------------------------------#define Num 10int A[10]={0};// --------------------------------------------------------void RandomNum() &amp;nbsp;//氣泡排序法之副程式{	int i;	srand((unsigned)time(NULL));	printf(&quot;產生10個亂數值：&quot;);	for (i = 1; i &amp;lt;= Num; i++)&amp;nbsp;&amp;nbsp; &amp;nbsp;{		A[i] = rand() % 90+10; &amp;nbsp;//產生10~100的整數亂數值		printf(&quot;%4d&quot;,A[i]);&amp;nbsp;&amp;nbsp; &amp;nbsp;}}// --------------------------------------------------------void PrintBubSort(int A[], int n) &amp;nbsp;//氣泡排序法之副程式&amp;nbsp;{&amp;nbsp;&amp;nbsp; &amp;nbsp;int i;	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;\n *** 排序10個亂數值： &quot;); &amp;nbsp;	&amp;nbsp;&amp;nbsp; &amp;nbsp;for (i = 0; i &amp;lt;= Num; i++)&amp;nbsp;&amp;nbsp; &amp;nbsp;{		printf(&quot;%4d&quot;, A[i]);&amp;nbsp;&amp;nbsp; &amp;nbsp;} &amp;nbsp;&amp;nbsp;}// --------------------------------------------------------void BubSort(int A[], int n) &amp;nbsp;//氣泡排序法之副程式{&amp;nbsp;&amp;nbsp; &amp;nbsp;int i, j , t=1, Temp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (i=n-1; i&amp;gt;0; i--)	{		printf(&quot;\n *** i= %d\n&quot;, i);				for (j =0; j &amp;lt;=i; j++) {			if (A[j] &amp;gt; A[j+1])			{ &amp;nbsp;//兩數交換位置				// show data				printf(&quot;swap data of a[j]= %d, a[j+1]= %d\n&quot;, A[j], A[j+1]);								Temp = A[j];				A[j] = A[j+1];				A[j+1] = Temp;			}&amp;nbsp;					}		PrintBubSort(A, n); &amp;nbsp; &amp;nbsp; //呼叫排序後的結果之副程式		printf(&quot;\n&quot;);				system(&quot;pause&quot;);			}}// --------------------------------------------------------// check_data(A, Num);void check_data(int a[], int n){	//	int i, j;		printf(&quot;\n in check_data(), n= %d\n&quot;, n);	system(&quot;pause&quot;);		// 0 - (n-1)	for (i=0;i&amp;lt;=(n-1);i++) {		j= i + 1;				// we hope, a[i] &amp;lt;= a[j]		if (a[i] &amp;gt; a[j]) {			printf(&quot;\n *** error in check_data(), \n&quot;);			printf(&quot;a[i]= %d, a[j]= %d\n&quot;, a[i], a[j]);			system(&quot;pause&quot;);						exit(1);		}	}		printf(&quot;\n *** check OK in check_data()\n&quot;);	system(&quot;pause&quot;);			}// end of check_data()// --------------------------------------------------------int main(){ //主程式	//		// generate data	&amp;nbsp;&amp;nbsp; &amp;nbsp;RandomNum(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//呼叫產生10個亂數值的副程式	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;\n&quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;BubSort(A, Num); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//呼叫氣泡排序法的副程式		// check the data	check_data(A, Num);	&amp;nbsp;&amp;nbsp; &amp;nbsp;PrintBubSort(A, Num); &amp;nbsp; &amp;nbsp; //呼叫排序後的結果之副程式&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;\n&quot;);&amp;nbsp;	&amp;nbsp;&amp;nbsp; &amp;nbsp;system(&quot;PAUSE&quot;);	&amp;nbsp;&amp;nbsp; &amp;nbsp;return(0);}// end of main() </description>
		<pubDate>Fri, 24 Dec 2010 08:26:02 +0800</pubDate>
	</item>
	<item>
		<title>使用 AUTOCAD 畫的 消波塊</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3853</link>
		<description>請參考 圖檔。 </description>
		<pubDate>Mon, 20 Dec 2010 14:49:37 +0800</pubDate>
	</item>
	<item>
		<title>srand() 和 rand() 的使用方法</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3851</link>
		<description>#if 0#endif// ----------------------------------------------#include &amp;lt;cstdlib&amp;gt;#include &amp;lt;iostream&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;time.h&amp;gt;// ----------------------------------------------using namespace std;// ----------------------------------------------int main(int argc, char *argv[]){&amp;nbsp;&amp;nbsp; int i;&amp;nbsp;&amp;nbsp; // srand((unsigned) time(NULL));&amp;nbsp;&amp;nbsp; srand(327);&amp;nbsp;&amp;nbsp; for(i= 0;i&amp;lt;10;i++) {&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;printf( &quot; &amp;nbsp;%3d&quot;, (rand()%100));&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;\n&quot;);&amp;nbsp;&amp;nbsp; &amp;nbsp;system(&quot;PAUSE&quot;);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return EXIT_SUCCESS;}// end of main() </description>
		<pubDate>Mon, 20 Dec 2010 09:55:42 +0800</pubDate>
	</item>
	<item>
		<title>autocad geo- map dwg</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3843</link>
		<description>for 上課用。 </description>
		<pubDate>Sat, 18 Dec 2010 10:06:24 +0800</pubDate>
	</item>
	<item>
		<title>DC 的 &quot;hello, world!\n&quot;</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3787</link>
		<description>#if 0hello, world!請按任意鍵繼續 . . .#endif// --------------------------------------------------------#include &amp;lt;cstdlib&amp;gt;#include &amp;lt;iostream&amp;gt;using namespace std;// --------------------------------------------------------int main(int argc, char *argv[]){&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;hello, world!\n&quot;);&amp;nbsp;&amp;nbsp; &amp;nbsp;system(&quot;PAUSE&quot;);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return EXIT_SUCCESS;} </description>
		<pubDate>Wed, 15 Dec 2010 11:22:11 +0800</pubDate>
	</item>
	<item>
		<title>10秒鐘，可以產生 六千萬個 亂數</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3768</link>
		<description>#include &quot;inc-01.h&quot;// ----------------------------------------------// &amp;nbsp; rnd1( &amp;nbsp; &amp;nbsp;&amp;amp;s1);void rnd1(int *s1){	double x1, x2;	x1= (double) (*s1);		// x1= (x1*a + b) mod c;// a= 16807, b= 0, c= 2147483647	x2= fmod((x1*16807.0), 2147483647.0);		(*s1)= (int) (x2 + 0.5);}// end of rnd1()// ----------------------------------------------// &amp;nbsp; init_rnd( &amp;nbsp; &amp;nbsp;&amp;amp;s1);void init_rnd(int *s1){	int t1, t2, i;		time1(&amp;amp;t1);// get t1		t2= t1;// t2 == t1	while (t2 == t1) {		time1(&amp;amp;t1);// get a new t1	}		// t1 &amp;lt;&amp;gt; t2	for (i=0;i&amp;lt;300;i++) {		rnd1(&amp;amp;t1);	}		(*s1)= t1;}// end of init_rnd()// ----------------------------------------------// &amp;nbsp; swap_int(&amp;amp;i1, &amp;amp;i2);void swap_int(int *i1, int *i2){	int temp;		temp= *i1;	*i1= *i2;	*i2= temp;	}// end of swap_int()// ----------------------------------------------// &amp;nbsp; rnd2(s1, &amp;amp;x);void rnd2(int *s1, double *x){	rnd1(s1);		*x= ((double) *s1)/2147483648.0;}// end of rnd2()// ----------------------------------------------// &amp;nbsp; irnd(&amp;amp;s1, i1, i2, &amp;amp;ii);void irnd(int *s1, int i1, int i2, int *ii){	// must i1 &amp;lt;= i2	if (i1 &amp;gt; i2) {		swap_int(&amp;amp;i1, &amp;amp;i2);	}		double x;	rnd2(s1, &amp;amp;x);		(*ii)= (int) (x*(i2 - i1 + 1) + i1);}// end of&amp;nbsp;// ----------------------------------------------int main(){	int s1, t1, i, no;	double dt;		no= (int) (6000e4 + 0.5);		init_rnd(&amp;amp;s1);		time1(&amp;amp;t1);	for (i=0;i&amp;lt;no;i++) {		rnd1(&amp;amp;s1);	}	time2(t1, &amp;amp;dt);		printf(&quot;no= %ld, dt= %.3lf\n&quot;, no, dt);	pause();	return(0);}// ----------------------------------------------#if 0no= 60000000, dt= 10.125Press [Esc] for stop! other key for continue...#endif// ---------------------------------------------- </description>
		<pubDate>Tue, 14 Dec 2010 12:21:23 +0800</pubDate>
	</item>
	<item>
		<title>為何要重視 int_max</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3764</link>
		<description>假設，我要寫 計算時間 間隔的副程式，我必須知道，計算時間，使用 ms 做單位，如果 時間的間隔 超過 24天，就會 over- flow產生錯誤的結果。或是，計算的時間間隔，跨越 24天週期的 分界線，也是會產生錯誤的結果，而且不會有任何的compiler 給的錯誤，或是警告的訊息。跑程式的時候，即使發生錯誤，也不會有任何的錯誤，或是警告訊息。所以，一切都要靠自己。#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;// ----------------------------------------------int main(){	int a= (int) ((pow(2, 31)) - 1 + 0.5);	printf(&quot;a= %d\n&quot;, a);	system(&quot;pause&quot;);		int b= a/1000/(1L*24*60*60);	int c= b*(1L*24*60*60)*1000;		printf(&quot;b= %d, c= %d\n&quot;, b, c);	system(&quot;pause&quot;);		return(0);}// ----------------------------------------------#if 0a= 2147483647請按任意鍵繼續 . . .b= 24, c= 2073600000請按任意鍵繼續 . . .#endif// ---------------------------------------------- </description>
		<pubDate>Tue, 14 Dec 2010 06:19:12 +0800</pubDate>
	</item>
	<item>
		<title>最短的 C程式語言</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3745</link>
		<description>main(){}// ----------------------------------------------------------------------------#if 0--------------------Configuration: VC1214 - Win32 Debug--------------------Compiling...VC1214.CPPD:\VC1214\VC1214.CPP(3) : warning C4508: &#039;main&#039; : function should return a value; &#039;void&#039; return type assumedLinking...VC1214.exe - 0 error(s), 1 warning(s)#endif// ---------------------------------------------------------------------------- </description>
		<pubDate>Mon, 13 Dec 2010 06:44:28 +0800</pubDate>
	</item>
	<item>
		<title>C++程式，處理 fortran 的輸出</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3712</link>
		<description>#if 0然後 產生 autocad script file 的範例ct1= &amp;nbsp; 1, x= 0.000000, y= 0.000000ct1= &amp;nbsp; 2, x= 0.196350, y= 0.195090ct1= &amp;nbsp; 3, x= 0.392699, y= 0.382683ct1= &amp;nbsp; 4, x= 0.589049, y= 0.555570ct1= &amp;nbsp; 5, x= 0.785398, y= 0.707107ct1= &amp;nbsp; 6, x= 0.981748, y= 0.831470ct1= &amp;nbsp; 7, x= 1.178097, y= 0.923880ct1= &amp;nbsp; 8, x= 1.374447, y= 0.980785ct1= &amp;nbsp; 9, x= 1.570796, y= 1.000000ct1= &amp;nbsp;10, x= 1.767146, y= 0.980785ct1= &amp;nbsp;11, x= 1.963495, y= 0.923880ct1= &amp;nbsp;12, x= 2.159845, y= 0.831470ct1= &amp;nbsp;13, x= 2.356194, y= 0.707107ct1= &amp;nbsp;14, x= 2.552544, y= 0.555570ct1= &amp;nbsp;15, x= 2.748894, y= 0.382683ct1= &amp;nbsp;16, x= 2.945243, y= 0.195090ct1= &amp;nbsp;17, x= 3.141593, y= 0.000000&amp;nbsp;Press [Esc] for stop! other key for continue...#endif// ----------------------------------------------#include &quot;inc-01.h&quot;#include &quot;sj-01.h&quot;#include &quot;sj-02.h&quot;// ----------------------------------------------int main(){	FILE *f1, *f2;	double x, y;	f1= fopen(&quot;plot-sin.txt&quot;, &quot;rt&quot;);	f2= fopen(&quot;plot-sin.scr&quot;, &quot;wt&quot;);	int ct1= 0, ct2;	fprintf(f2, &quot;spline\n&quot;);	while (!feof(f1)) {		ct2= fscanf(f1, &quot;%lf %lf&quot;, &amp;amp;x, &amp;amp;y);		if (ct2 != 2) break;		ct1++;		printf(&quot;ct1= %3d, x= %.6lf, y= %.6lf\n&quot;, ct1, x, y);		fprintf(f2, &quot;%.6lf,%.6lf\n&quot;, x, y);	}	fprintf(f2, &quot;\n\n\n&quot;);	fclose(f1);	fclose(f2);	pause();	return 0;}// end of main() </description>
		<pubDate>Wed, 08 Dec 2010 14:44:45 +0800</pubDate>
	</item>
	<item>
		<title>fortran 產生文字檔的 範例</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3710</link>
		<description>!dec$if(.false.)檔案的內容是y= sin(), x= 0 to 3.1415926 step dxdx= 16等分準備教&amp;nbsp;&amp;nbsp; 0.000000 &amp;nbsp;0.000000&amp;nbsp;&amp;nbsp; 0.196350 &amp;nbsp;0.195090&amp;nbsp;&amp;nbsp; 0.392699 &amp;nbsp;0.382683&amp;nbsp;&amp;nbsp; 0.589049 &amp;nbsp;0.555570&amp;nbsp;&amp;nbsp; 0.785398 &amp;nbsp;0.707107&amp;nbsp;&amp;nbsp; 0.981748 &amp;nbsp;0.831470&amp;nbsp;&amp;nbsp; 1.178097 &amp;nbsp;0.923880&amp;nbsp;&amp;nbsp; 1.374447 &amp;nbsp;0.980785&amp;nbsp;&amp;nbsp; 1.570796 &amp;nbsp;1.000000&amp;nbsp;&amp;nbsp; 1.767146 &amp;nbsp;0.980785&amp;nbsp;&amp;nbsp; 1.963495 &amp;nbsp;0.923880&amp;nbsp;&amp;nbsp; 2.159845 &amp;nbsp;0.831470&amp;nbsp;&amp;nbsp; 2.356194 &amp;nbsp;0.707107&amp;nbsp;&amp;nbsp; 2.552544 &amp;nbsp;0.555570&amp;nbsp;&amp;nbsp; 2.748894 &amp;nbsp;0.382683&amp;nbsp;&amp;nbsp; 2.945243 &amp;nbsp;0.195090&amp;nbsp;&amp;nbsp; 3.141593 &amp;nbsp;0.000000!dec$endif! ---------------------------------------------------------	program VF0904	implicit none	integer no	real x, y, x1, x2, dx	! plot y= sin(x), x= 0 to pi step dx	no= 16	x1= 0.0	x2= 4.0*atan(1.0)	dx= (x2 - x1)/no	x2= x2 + 0.1*dx	! for x= x1 to x2 step dx do ...	x= x1	open(unit= 1, file= &#039;plot-sin.txt&#039;, status= &#039;UNKNOWN&#039;);	do while (x .LE. x2)	 &amp;nbsp; y= sin(x)	 &amp;nbsp; write(unit= 1, fmt= &#039;(1x, 2F10.6)&#039;)x, y	 &amp;nbsp; x= x + dx	end do	close(1);	print *, &#039;Done!&#039;	pause	end program VF0904 </description>
		<pubDate>Wed, 08 Dec 2010 14:16:14 +0800</pubDate>
	</item>
	<item>
		<title>fortran 的 real*8 的精確度</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3706</link>
		<description>!dec$if(.false.)&amp;nbsp;&amp;nbsp; 11.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10.0000000000000Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;9007199450284736.000 &amp;nbsp; &amp;nbsp; 9007199450284736.000Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.!dec$endif! ---------------------------------------------------------	program VF0904	implicit none	real*8 a, b	a= 10.0D0	b= a + 1.0D0	! b= 11, &amp;gt; 10, b &amp;gt; a	print *, b, a	pause	do while (b .GT. a)	 &amp;nbsp; a= a*(1.0D0 + 1.0D-7)	 &amp;nbsp; b= a + 1.0D0	end do	! not for (b &amp;gt; a), --&amp;gt; b &amp;lt;= a	write(*, &#039;(1x, 2F25.3)&#039;)b, a	pause	end program VF0904 </description>
		<pubDate>Wed, 08 Dec 2010 08:18:11 +0800</pubDate>
	</item>
	<item>
		<title>fortran 的 real 精確度</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3705</link>
		<description>!dec$if(.false.)&amp;nbsp;&amp;nbsp; 11.00000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 10.00000Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.&amp;nbsp;&amp;nbsp; &amp;nbsp;16777216.000 &amp;nbsp; 16777216.000Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.!dec$endif! ---------------------------------------------------------	program VF0904	implicit none	real a, b	a= 10.0	b= a + 1.0	! b= 11, &amp;gt; 10, b &amp;gt; a	print *, b, a	pause	do while (b .GT. a)	 &amp;nbsp; a= a + 1.0	 &amp;nbsp; b= b + 1.0	end do	! not for (b &amp;gt; a), --&amp;gt; b &amp;lt;= a	write(*, &#039;(1x, 2F15.3)&#039;)b, a	pause	end program VF0904 </description>
		<pubDate>Wed, 08 Dec 2010 07:23:00 +0800</pubDate>
	</item>
	<item>
		<title>fortran 的 max. integer</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3704</link>
		<description>!dec$if(.false.)&amp;nbsp;b, a= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.&amp;nbsp;b, a= &amp;nbsp;-2147483648 &amp;nbsp;2147483647Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.!dec$endif! ---------------------------------------------------------	program VF0904	implicit none	integer a, b	a= 10	b= a + 1	! 11 &amp;gt; 10, b &amp;gt; a	print *, &#039;b, a= &#039;, b, a	pause	do while (b .GT. a)	 &amp;nbsp; a= a + 1	 &amp;nbsp; b= a + 1	end do	! not of (b &amp;gt; a) --&amp;gt; b &amp;lt;= a, why?	print *, &#039;b, a= &#039;, b, a	pause	end program VF0904 </description>
		<pubDate>Wed, 08 Dec 2010 06:49:58 +0800</pubDate>
	</item>
	<item>
		<title>如何證明 double 浮點數的精確度的有效位數</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3696</link>
		<description>請參考下面的 程式設計，double 是八個 Bytes 的變數型態，有 64個 bits, 第一個 bits 用來表示 浮點數的正負。使用 11個 bits 來表示 浮點數的 數量級。可以用來表示 (2^-1024) 到 (2^+1023) 範圍的 浮點數，大概是 十進位數字的(10^-308) 到 (10^308)剩下的 52個 bits 是用來表示 浮點數的 內容。所以，精確度可以到達 相對誤差：(1.0)/(2^52), 也就是 十進位的大概 16 - 17位的 有效位數。#if 0&amp;nbsp;b= 4.14159265358979310000,&amp;nbsp;a= 3.14159265358979310000&amp;nbsp;Press [Esc] for stop! other key for continue...&amp;nbsp;b= 9007199771293056.000,&amp;nbsp;a= 9007199771293056.000&amp;nbsp;Press [Esc] for stop! other key for continue...#endif// ----------------------------------------------#include &quot;inc-01.h&quot;#include &quot;sj-01.h&quot;#include &quot;sj-02.h&quot;// ----------------------------------------------int main(){	double a, b;	a= 4.0*atan(1.0);	b= a + 1;// (a + 1) &amp;gt; a, so b &amp;gt; a	printf(&quot;\n b= %.20lf, \n a= %.20lf\n&quot;, b, a);	pause();	while (b &amp;gt; a) {		a= a*(1.0 + 1e-7);		b= a + 1.0;	}	// !(b &amp;gt; a), --&amp;gt; b &amp;lt;= a	printf(&quot;\n b= %.3lf, \n a= %.3lf\n&quot;, b, a);	pause();	return 0;}// end of main() </description>
		<pubDate>Tue, 07 Dec 2010 16:33:29 +0800</pubDate>
	</item>
	<item>
		<title>如何證明 int 的範圍？</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3695</link>
		<description>以下的程式，可以證明 int 的範圍是-2147483648 到 +2147483647也就是&amp;nbsp;(-2^31) 到 (2^31) - 1int 是 四個 Bytes 的整數，是 32個 bits 的整數，有一個 bit 被用來表示 正，或是 負。剩下的 31 個 bits, 可以用來表示0 - +2147483647負的整數，使用 二的補數來表示。所以，40000*60000 --&amp;gt; ???其結果，是一個 負的整數。#if 0&amp;nbsp;b= 11, a= 10&amp;nbsp;Press [Esc] for stop! other key for continue...&amp;nbsp;*** exit the loop,&amp;nbsp;b= -2147483648, a= 2147483647&amp;nbsp;Press [Esc] for stop! other key for continue...#endif// ----------------------------------------------#include &quot;inc-01.h&quot;#include &quot;sj-01.h&quot;#include &quot;sj-02.h&quot;// ----------------------------------------------int main(){	int a, b;	a= 10;	b= a + 1;// b= 11, &amp;gt; 10, &amp;gt; a	printf(&quot;\n b= %d, a= %d\n&quot;, b, a);	pause();	while (b &amp;gt; a) {		a= a + 1;		b= a + 1;	}	// !(b &amp;gt; a), --&amp;gt; b &amp;lt;= a	printf(&quot;\n *** exit the loop, \n b= %d, a= %d\n&quot;, b, a);	pause();	return 0;}// end of main() </description>
		<pubDate>Tue, 07 Dec 2010 16:15:29 +0800</pubDate>
	</item>
	<item>
		<title>A2D EX.02</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3679</link>
		<description>...RECTANG@200,100@DX,DY@R&amp;lt;THETALINEBPOLYALIGNDIM           </description>
		<pubDate>Mon, 06 Dec 2010 12:10:40 +0800</pubDate>
	</item>
	<item>
		<title>AUTOCAD 2D EXAM. 01</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3676</link>
		<description>CIRCLEPDMODEDIVIDEOSNAPARCARRAYBPOLYAREA     </description>
		<pubDate>Mon, 06 Dec 2010 09:47:36 +0800</pubDate>
	</item>
	<item>
		<title>fortran 的 時間計算 基礎</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3642</link>
		<description>!dec$if(.false.)底下是 online help , 關於 date_and_time() 的說明DATE_AND_TIMEIntrinsic Subroutine: Returns character data on the real-time clock and date&amp;nbsp;in a form compatible with the representations defined in Standard ISO 8601:1988.&amp;nbsp;Syntax&amp;nbsp;CALL DATE_AND_TIME ( [date] [, time] [, zone] [, values] )date&amp;nbsp;(Optional; output) Must be scalar and of type default character; its length must be at least 8&amp;nbsp;to contain the complete value. Its leftmost 8 characters are set to a value of the form CCYYMMDD, where:CC &amp;nbsp;Is the century &amp;nbsp;YY &amp;nbsp;Is the year within the century &amp;nbsp;MM &amp;nbsp;Is the month within the year &amp;nbsp;DD &amp;nbsp;Is the day within the month&amp;nbsp;time&amp;nbsp;(Optional; output) Must be scalar and of type default character; its length must be&amp;nbsp;at least 10 to contain the complete value. Its leftmost 10 characters are set to a value of the form hhmmss.sss, where:hh &amp;nbsp;Is the hour of the day &amp;nbsp;mm &amp;nbsp;Is the minutes of the hour&amp;nbsp;ss.sss &amp;nbsp;Is the seconds and milliseconds of the minute &amp;nbsp;zone&amp;nbsp;(Optional; output) Must be scalar and of type default character; its length must be&amp;nbsp;at least 5 to contain the complete value. Its leftmost 5 characters are set to a value&amp;nbsp;of the form hhmm, where hh and mm are the time difference with respect to Coordinated&amp;nbsp;Universal Time (UTC) in hours and parts of an hour expressed in minutes, respectively.&amp;nbsp;UTC (also known as Greenwich Mean Time) is defined by CCIR Recommendation 460-2.values&amp;nbsp;(Optional; output) Must be of type default integer. One-dimensional array with size of&amp;nbsp;at least 8. The values returned in values are as follows:values (1) &amp;nbsp;The 4-digit year &amp;nbsp;values (2) &amp;nbsp;The month of the year &amp;nbsp;values (3) &amp;nbsp;The day of the month &amp;nbsp;values (4) &amp;nbsp;The time difference with respect to Coordinated Universal Time (UTC) in minutes &amp;nbsp;values (5) &amp;nbsp;The hour of the day (range 0 to 23) - local time &amp;nbsp;values (6) &amp;nbsp;The minutes of the hour (range 0 to 59) - local time &amp;nbsp;values (7) &amp;nbsp;The seconds of the minute (range 0 to 59) - local time &amp;nbsp;values (8) &amp;nbsp;The milliseconds of the second (range 0 to 999) - local time &amp;nbsp;Compatibility&amp;nbsp;CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB&amp;nbsp;See Also: GETDAT, GETTIM, IDATE, FDATE, TIME, ITIME, RTC, CLOCKExample&amp;nbsp;Consider the following example executed on 2000 March 28 at 11:04:14.5:&amp;nbsp;&amp;nbsp;INTEGER DATE_TIME (8)&amp;nbsp;&amp;nbsp;CHARACTER (LEN = 12) REAL_CLOCK (3)&amp;nbsp;&amp;nbsp;CALL DATE_AND_TIME (REAL_CLOCK (1), REAL_CLOCK (2), &amp;amp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;REAL_CLOCK (3), DATE_TIME)This assigns the value &quot;20000328&quot; to REAL_CLOCK (1), the value &quot;110414.500&quot; to REAL_CLOCK (2), and the value &quot;-0500&quot; to REAL_CLOCK (3). The following values are assigned to DATE_TIME: 2000, 3, 28, -300, 11, 4, 14, and 500.The following shows another example:CHARACTER(10) tCHARACTER(5) zCALL DATE_AND_TIME(TIME = t, ZONE = z)!dec$endif! ---------------------------------------------------------	program VF0904	implicit none	!&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER DATE_TIME(8), i, ms&amp;nbsp;&amp;nbsp; &amp;nbsp;CHARACTER(LEN= 12) REAL_CLOCK(3)&amp;nbsp;&amp;nbsp; &amp;nbsp;CALL DATE_AND_TIME (REAL_CLOCK (1), REAL_CLOCK (2), &amp;amp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;REAL_CLOCK (3), DATE_TIME)&amp;nbsp;&amp;nbsp; &amp;nbsp;!	do i=1, 3	 &amp;nbsp; print *, &#039;i, data= &#039;, i, real_clock(i)	end do	pause	do i=1, 8	 &amp;nbsp; print *, &#039;i, data= &#039;, i, date_time(i)	end do	pause	ms= date_time(3) ! = day number	ms= mod(ms, 21) ! max.= 21- days	ms= ms*24 + date_time(5) ! --&amp;gt; hours	ms= ms*60 + date_time(6) ! --&amp;gt; min	ms= ms*60 + date_time(7) ! --&amp;gt; sec	ms= ms*1000 + date_time(8) ! --&amp;gt; ms	print *, &#039;ms= &#039;, ms	pause	end program VF0904	! -----------------------------------------------------!dec$if(.false.)!dec$endif </description>
		<pubDate>Fri, 03 Dec 2010 09:27:50 +0800</pubDate>
	</item>
	<item>
		<title>需要寫 ㄧ堆的 副程式</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3638</link>
		<description>模擬 你的需求寄件人gmail.com隱藏詳細資料&amp;nbsp;21:56 (8 分鐘前)1000 到 9999 取 200個亂數，然後，測試 是否為 質數，如果是 質數的話，寫入 檔案PRIME-N.DATN= 該質數的 千位數，你看 如何？為了 完成這個程式，需要 ㄧ些 副程式翰 函數。call skip(3)可以 空三行的 輸出call pause暫停call time1(t1)t1 能夠逮表目前的 時間刻度，單位是 mscall time2(t1, dt)計算 從 t1 到現在，所經過的 秒數，單位是 秒call rnd1(s1)把 s1 丟進去，產生 新的 s1s1 是亂數，1 &amp;lt;= s1 &amp;lt;= 2147483646call rnd2(s1, x1)s1 的說明，同上面。0.0 &amp;lt; x1 &amp;lt; 1.0call irnd(s1, i1, i2, ii)s1 的說明，同上面。i1, i2 是 input, ii 是 output,i1 &amp;lt;= ii &amp;lt;= i2call init_rnd(s1)呼叫 time1(), 產生 亂數的 種子數 s1is_prime(no)測試 no 是否為 質數 </description>
		<pubDate>Thu, 02 Dec 2010 22:05:39 +0800</pubDate>
	</item>
	<item>
		<title>浮點數，也是 ㄧ樣。(a + 1) 不一定 &gt; a</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3637</link>
		<description>換成 real, 如何解釋那個 結果？寄件人gmail.com隱藏詳細資料&amp;nbsp;21:40 (22 分鐘前)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;implicit none&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;real a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a= 4.0*atan(1.0)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b= a + 1.0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! b= 4.1415926, &amp;gt; 3.1415926, b &amp;gt; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;a, b= &#039;, a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pause&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! -----------------------------------------------------&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do while (b .GT. a)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a= a + 1.0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b= a + 1.0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end do&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! b &amp;lt;= a, 怎麼可能 (a + 1) &amp;lt;= a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;exit do while(), b &amp;lt;= a&#039;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;a, b= &#039;, a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pause&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! -----------------------------------------------------!dec$if(.false.)&amp;nbsp;a, b= &amp;nbsp; &amp;nbsp;3.141593 &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.141593Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.&amp;nbsp;exit do while(), b &amp;lt;= a&amp;nbsp;a, b= &amp;nbsp; 1.6777216E+07 &amp;nbsp;1.6777216E+07Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.!dec$endif </description>
		<pubDate>Thu, 02 Dec 2010 22:04:26 +0800</pubDate>
	</item>
	<item>
		<title>(a + 1) 不一定 &gt; a</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3636</link>
		<description>阿，這個 程式呢？寄件人gmail.com隱藏詳細資料&amp;nbsp;21:16 (45 分鐘前)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;implicit none&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;integer a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a= 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b= a + 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! b= 11, &amp;gt; 10, b &amp;gt; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;a, b= &#039;, a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pause&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! -----------------------------------------------------&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do while (b .GT. a)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a= a + 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b= a + 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end do&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! b &amp;lt;= a, 怎麼可能 (a + 1) &amp;lt;= a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;exit do while(), b &amp;lt;= a&#039;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;a, b= &#039;, a, b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pause&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! -----------------------------------------------------!dec$if(.false.)&amp;nbsp;a, b= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.&amp;nbsp;exit do while(), b &amp;lt;= a&amp;nbsp;a, b= &amp;nbsp; 2147483647 -2147483648Fortran Pause - Enter command&amp;lt;CR&amp;gt; or &amp;lt;CR&amp;gt; to continue.!dec$endif </description>
		<pubDate>Thu, 02 Dec 2010 22:03:03 +0800</pubDate>
	</item>
	<item>
		<title>fortran 的 &quot;hello, world&quot;</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3635</link>
		<description>這個程式，有沒有哪裏 不了解的寄件人gmail.com隱藏詳細資料&amp;nbsp;21:10 (50 分鐘前)! &amp;nbsp;VF0904.f90!! &amp;nbsp;FUNCTIONS:! &amp;nbsp; &amp;nbsp; &amp;nbsp; VF0904 &amp;nbsp; &amp;nbsp; &amp;nbsp;- Entry point of console application.!! &amp;nbsp; &amp;nbsp; &amp;nbsp; Example of displaying &#039;Hello World&#039; at execution time.!!****************************************************************************!! &amp;nbsp;PROGRAM: VF0904!! &amp;nbsp;PURPOSE: &amp;nbsp;Entry point for &#039;Hello World&#039; sample console application.!!****************************************************************************&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;implicit none&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;integer a, b, c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a= 40000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b= 60000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c= a*b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print *, &#039;Hello World, c= &#039;, c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end program VF0904&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;! -----------------------------------------------------!dec$if(.false.)&amp;nbsp;Hello World, c= &amp;nbsp;-1894967296Press any key to continue!dec$endif </description>
		<pubDate>Thu, 02 Dec 2010 22:01:44 +0800</pubDate>
	</item>
	<item>
		<title>叫 AUTOCAD 自動畫 SIN 函數圖形的 AUTOLISP 程式</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3566</link>
		<description>; FILE: PLOT-SIN.LSP; PLOT Y= SIN(X), X= X1 TO X2 STEP DX(SETQ NO 16)(SETQ X1 0.0&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;X2 (* 4.0 (ATAN 1.0))&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;DX (/ (- X2 X1) NO))(SETQ X2 (+ X2 (/ DX 10.0))); FOR X= X1 TO X2 STEP DX(SETQ X X1)(COMMAND &quot;SPLINE&quot;)(WHILE (&amp;lt;= X X2)&amp;nbsp;&amp;nbsp;(SETQ Y (SIN X))&amp;nbsp;&amp;nbsp;(SETQ P1 (LIST X Y))&amp;nbsp;&amp;nbsp;(COMMAND P1)&amp;nbsp;&amp;nbsp;(SETQ X (+ X DX))&amp;nbsp;&amp;nbsp;); END OF WHILE()(COMMAND &quot;&quot; &quot;&quot; &quot;&quot;)(PRINC); END OF FILE </description>
		<pubDate>Mon, 29 Nov 2010 17:15:46 +0800</pubDate>
	</item>
	<item>
		<title>好用的 time1(), time2() 副程式</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3488</link>
		<description>以下，20億個 加法運算，需要多少時間？只看 主程式的部份，是不是很簡潔啊？#if 0no= &amp;nbsp; 2000000000, sum= &amp;nbsp;-1973237248, dt= 7.828&amp;nbsp;Press [Esc] for stop! other key for continue...#endif// ----------------------------------------------#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;conio.h&amp;gt;#include &amp;lt;sys/timeb.h&amp;gt;#include &amp;lt;time.h&amp;gt;// ----------------------------------------------#include &quot;sj-01.h&quot;// ----------------------------------------------void time1(int *t1){	struct _timeb timebuffer;	int ms, sec;		_ftime( &amp;amp;timebuffer );	ms= timebuffer.millitm;	sec= timebuffer.time;	sec%= (21L*86400L);// max. = 24.8 day, so ...		(*t1)= sec*1000 + ms;}// end of time1()// ----------------------------------------------void time2(int t1, double *dt){	int t2;		time1(&amp;amp;t2);	(*dt)= ((double) (t2 - t1))/1000.0;		// (*dt) must &amp;gt;= 0	if ((*dt) &amp;lt; 0) {		(*dt)+= (21L*86400L);	}}// end of time2()// ----------------------------------------------int main(){	// 20億個 加法運算，需要多少時間？	int no= (int) (20E8 + 0.5);// 四捨五入	int sum, i, t1;	double dt;	time1(&amp;amp;t1);	sum= 0;	for (i=1;i&amp;lt;=no;i++) {		sum+= i;	}	time2(t1, &amp;amp;dt);	printf(&quot;no= %12ld, sum= %12ld, dt= %.3lf\n&quot;, no, sum, dt);	pause();		return 0;}// end of main() </description>
		<pubDate>Fri, 19 Nov 2010 18:49:21 +0800</pubDate>
	</item>
	<item>
		<title>這個程式，證明 ftime() 的精確度只有到 15 ms</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3477</link>
		<description>#if 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;210, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;820, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3240, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;160, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12880, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;320, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;51360, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;640, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; 205120, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1280, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; 819840, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2560, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp;3278080, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5120, sum= &amp;nbsp; &amp;nbsp; 13109760, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10240, sum= &amp;nbsp; &amp;nbsp; 52433920, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20480, sum= &amp;nbsp; &amp;nbsp;209725440, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40960, sum= &amp;nbsp; &amp;nbsp;838881280, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;81920, sum= &amp;nbsp; -939483136, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; 163840, sum= &amp;nbsp; &amp;nbsp;536952832, dt= 0.016no= &amp;nbsp; &amp;nbsp; &amp;nbsp; 327680, sum= &amp;nbsp;-2147319808, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp; 655360, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; 327680, dt= 0.000no= &amp;nbsp; &amp;nbsp; &amp;nbsp;1310720, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; 655360, dt= 0.015no= &amp;nbsp; &amp;nbsp; &amp;nbsp;2621440, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp;1310720, dt= 0.032no= &amp;nbsp; &amp;nbsp; &amp;nbsp;5242880, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp;2621440, dt= 0.046no= &amp;nbsp; &amp;nbsp; 10485760, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp;5242880, dt= 0.079no= &amp;nbsp; &amp;nbsp; 20971520, sum= &amp;nbsp; &amp;nbsp; 10485760, dt= 0.093no= &amp;nbsp; &amp;nbsp; 41943040, sum= &amp;nbsp; &amp;nbsp; 20971520, dt= 0.219no= &amp;nbsp; &amp;nbsp; 83886080, sum= &amp;nbsp; &amp;nbsp; 41943040, dt= 0.313no= &amp;nbsp; &amp;nbsp;167772160, sum= &amp;nbsp; &amp;nbsp; 83886080, dt= 0.625no= &amp;nbsp; &amp;nbsp;335544320, sum= &amp;nbsp; &amp;nbsp;167772160, dt= 1.453no= &amp;nbsp; &amp;nbsp;671088640, sum= &amp;nbsp; &amp;nbsp;335544320, dt= 2.718no= &amp;nbsp; 1342177280, sum= &amp;nbsp; &amp;nbsp;671088640, dt= 6.360Press any key to continue#endif// ----------------------------------------------#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;conio.h&amp;gt;#include &amp;lt;sys/timeb.h&amp;gt;#include &amp;lt;time.h&amp;gt;// ----------------------------------------------#include &quot;sj-01.h&quot;// ----------------------------------------------void time1(int *t1){	struct _timeb timebuffer;	int ms, sec;		_ftime( &amp;amp;timebuffer );	ms= timebuffer.millitm;	sec= timebuffer.time;	sec%= (21*86400L);// max. = 24.8 day, so ...		(*t1)= sec*1000 + ms;}// end of time1()// ----------------------------------------------void time2(int t1, double *dt){	int t2;		time1(&amp;amp;t2);	(*dt)= ((double) (t2 - t1))/1000.0;		// (*dt) must &amp;gt;= 0	if ((*dt) &amp;lt; 0) {		(*dt)+= (21L*86400L);	}}// end of time2()// ----------------------------------------------int main(){	int t1, no= 10, sum, i;	double dt;		while (no &amp;gt; 0) {		time1(&amp;amp;t1);		sum= 0;		for (i=1;i&amp;lt;=no;i++) {			sum+= i;		}		time2(t1, &amp;amp;dt);				printf(&quot;no= %12ld, sum= %12ld, dt= %.3lf\n&quot;, no, sum, dt);		no*= 2;	}		return 0;}// end of main() </description>
		<pubDate>Fri, 19 Nov 2010 11:14:08 +0800</pubDate>
	</item>
	<item>
		<title>這個程式，證明微軟的 MSDN 的範例錯誤</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3459</link>
		<description>#if 0The time is Thu Nov 18 16:43:19.296 2010ms= 296&amp;nbsp;Press [Esc] for stop! other key for continue...The time is Thu Nov 18 16:43:20.46 2010ms= 046&amp;nbsp;Press [Esc] for stop! other key for continue...&amp;nbsp;上面，當 ms= 46的時候，必須印出來是 20.046,&amp;nbsp;卻發生錯誤，印成 20.46, 就是 20.460,&amp;nbsp;很明顯的，是一個 錯誤。微軟的 MSDN, 關於 ftime() 的範例程式，寫錯了。#endif// ----------------------------------------------#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;conio.h&amp;gt;#include &amp;lt;sys/timeb.h&amp;gt;#include &amp;lt;time.h&amp;gt;#include &quot;sj-01.h&quot;// ----------------------------------------------int main(){	struct _timeb timebuffer;	char *timeline;	int ms;		for (;;) {		skip(3);		_ftime( &amp;amp;timebuffer );		ms= timebuffer.millitm;		timeline = ctime( &amp;amp; ( timebuffer.time ) );				printf( &quot;The time is %.19s.%hu %s&quot;, timeline, timebuffer.millitm, &amp;amp;timeline[20] );		printf(&quot;ms= %03d\n&quot;, ms);		pause();	}		return 0;}// end of main() </description>
		<pubDate>Thu, 18 Nov 2010 16:48:09 +0800</pubDate>
	</item>
	<item>
		<title>把主程式和副程式的檔案 分開</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3441</link>
		<description>關鍵是#include &quot;file.h&quot;// 這是 主程式的 檔案#if 0#endif// ----------------------------------------------#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;conio.h&amp;gt;#include &quot;sj-01.h&quot;// ----------------------------------------------int main(){	int i;		for (i=1;i&amp;lt;=20;i++) {		skip(i);		printf(&quot;i= %5d, i*i= %5d, sqrt(i)= %10.6lf\n&quot;,&amp;nbsp;			i, &amp;nbsp; &amp;nbsp; &amp;nbsp;i*i, &amp;nbsp; &amp;nbsp; &amp;nbsp;sqrt(i));		pause();	}		return 0;}// end of main()// 以下，是副程式的檔案// file: sj-01.h// &amp;nbsp; skip(3);void skip(int no){	int i;		// limits no in 1 .. 20	if ((no &amp;gt;= 1) &amp;amp;&amp;amp; (no &amp;lt;= 20)) {// no is OK		for (i=1;i&amp;lt;=no;i++) {			// printf(&quot;*** in skip(), i= %d\n&quot;, i);			printf(&quot;\n&quot;);		}	}	else {// no is invalid		// printf(&quot;*** error in skip(), no= %d\n&quot;, no);		printf(&quot;\n&quot;);	}}// end of skip()// ----------------------------------------------// &amp;nbsp; pause();void pause(void){	// remove type- ahead	while (kbhit()) {		getch();	}	// ----------------------------------------------		printf(&quot; Press [Esc] for stop! other key for continue...&quot;);	do {		// wait for keyPressed!	} while (!kbhit());	int ch1= getch();	printf(&quot;\n&quot;);	// ----------------------------------------------		if (ch1==0x1b) {		exit(1);	}		// remove extra key- pressed	while (kbhit()) {		getch();	}}// end of pause() </description>
		<pubDate>Tue, 16 Nov 2010 17:28:42 +0800</pubDate>
	</item>
	<item>
		<title>skip(no) 和 pause() 兩個副程式</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3433</link>
		<description>#if 0#endif// ----------------------------------------------#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;conio.h&amp;gt;// ----------------------------------------------// &amp;nbsp; skip(3);void skip(int no){	int i;		// limits no in 1 .. 20	if ((no &amp;gt;= 1) &amp;amp;&amp;amp; (no &amp;lt;= 20)) {// no is OK		for (i=1;i&amp;lt;=no;i++) {			// printf(&quot;*** in skip(), i= %d\n&quot;, i);			printf(&quot;\n&quot;);		}	}	else {// no is invalid		// printf(&quot;*** error in skip(), no= %d\n&quot;, no);		printf(&quot;\n&quot;);	}}// end of skip()// ----------------------------------------------// &amp;nbsp; pause();void pause(void){	// remove type- ahead	while (kbhit()) {		getch();	}	// ----------------------------------------------		printf(&quot; Press [Esc] for stop! other key for continue...&quot;);	do {		// wait for keyPressed!	} while (!kbhit());	int ch1= getch();	printf(&quot;\n&quot;);	// ----------------------------------------------		if (ch1==0x1b) {		exit(1);	}		// remove extra key- pressed	while (kbhit()) {		getch();	}}// end of pause()// ----------------------------------------------int main(){	int i;		for (i=1;i&amp;lt;=20;i++) {		skip(i);		printf(&quot;i= %5d, i*i= %5d, sqrt(i)= %10.6lf\n&quot;,&amp;nbsp;			i, &amp;nbsp; &amp;nbsp; &amp;nbsp;i*i, &amp;nbsp; &amp;nbsp; &amp;nbsp;sqrt(i));		pause();	}		return 0;}// end of main() </description>
		<pubDate>Tue, 16 Nov 2010 07:45:41 +0800</pubDate>
	</item>
	<item>
		<title>系統所提供的亂數，不合預期</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3426</link>
		<description>#if 0理想中的亂數是，一 要儘可能的產生比較長的週期，也就是說，在出現相同的數字之前，所產生的 所有數字的 個數二 每一個數字的出現頻率要相同，所以，週期要 固定三 產生的速度要 儘可能的快s1= &amp;nbsp;20826, s2= &amp;nbsp;20826, ct= &amp;nbsp; 40354s1= &amp;nbsp;20829, s2= &amp;nbsp;20829, ct= &amp;nbsp; 32390s1= &amp;nbsp;20833, s2= &amp;nbsp;20833, ct= &amp;nbsp; &amp;nbsp;9846s1= &amp;nbsp;20836, s2= &amp;nbsp;20836, ct= &amp;nbsp; 47585s1= &amp;nbsp;20839, s2= &amp;nbsp;20839, ct= &amp;nbsp; &amp;nbsp;7268s1= &amp;nbsp;20842, s2= &amp;nbsp;20842, ct= &amp;nbsp; 24388s1= &amp;nbsp;20846, s2= &amp;nbsp;20846, ct= &amp;nbsp; &amp;nbsp;1273s1= &amp;nbsp;20849, s2= &amp;nbsp;20849, ct= &amp;nbsp; 21765s1= &amp;nbsp;20852, s2= &amp;nbsp;20852, ct= &amp;nbsp; 17792s1= &amp;nbsp;20856, s2= &amp;nbsp;20856, ct= &amp;nbsp; 24732s1= &amp;nbsp;20859, s2= &amp;nbsp;20859, ct= &amp;nbsp; 45344s1= &amp;nbsp;20862, s2= &amp;nbsp;20862, ct= &amp;nbsp; 96963s1= &amp;nbsp;20865, s2= &amp;nbsp;20865, ct= &amp;nbsp; 27246s1= &amp;nbsp;20869, s2= &amp;nbsp;20869, ct= &amp;nbsp; 28311s1= &amp;nbsp;20872, s2= &amp;nbsp;20872, ct= &amp;nbsp; 32888s1= &amp;nbsp;20875, s2= &amp;nbsp;20875, ct= &amp;nbsp; &amp;nbsp;8121s1= &amp;nbsp;20878, s2= &amp;nbsp;20878, ct= &amp;nbsp; 42342s1= &amp;nbsp;20882, s2= &amp;nbsp;20882, ct= &amp;nbsp; 31186s1= &amp;nbsp;20885, s2= &amp;nbsp;20885, ct= &amp;nbsp; 66311s1= &amp;nbsp;20888, s2= &amp;nbsp;20888, ct= &amp;nbsp; 68819s1= &amp;nbsp;20891, s2= &amp;nbsp;20891, ct= &amp;nbsp; &amp;nbsp;6028s1= &amp;nbsp;20895, s2= &amp;nbsp;20895, ct= &amp;nbsp; 25150s1= &amp;nbsp;20898, s2= &amp;nbsp;20898, ct= &amp;nbsp; 18894s1= &amp;nbsp;20901, s2= &amp;nbsp;20901, ct= &amp;nbsp; 43998以上，一共跑了 180趟，平均值 接近 32768,符合預期。但是，週期的變化，min= 99, max= 18萬多，不合規定，而且也是顯得 週期太短。min= &amp;nbsp; &amp;nbsp; &amp;nbsp; 99, max= 184309, ave.= 30662.267Press any key to continue#endif// ----------------------------------------------#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;time.h&amp;gt;void main( void ){	int i, ct, s1, s2, t1, t2, sum= 0;	int min, max;		min= 2000000000;	max= -min;		for (i=1;i&amp;lt;=(60*3);i++) {// do the 10- times		t1= time(NULL);		t2= time(NULL);		while (t2 == t1) {			t2= time(NULL);		}				srand(t2);		ct= 0;				s1= rand();		s2= rand();		// s2 &amp;lt;&amp;gt; s1		while (s2 != s1) {			s2= rand();			ct++;		}				printf(&quot;s1= %6d, s2= %6d, ct= %7d\n&quot;, s1, s2, ct);		if (min &amp;gt; ct) min= ct;		if (max &amp;lt; ct) max= ct;				sum+= ct;	}		printf(&quot;\n\n min= %8d, max= %5d, ave.= %.3lf\n&quot;, min, max, sum/(60.0*3));} </description>
		<pubDate>Mon, 15 Nov 2010 12:00:13 +0800</pubDate>
	</item>
	<item>
		<title>time() 的計算時間的 精確度</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3425</link>
		<description>只有到 秒。以下的程式的 輸出，可以看出一些 奇怪的現象。#if 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 55, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;465, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 90, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4095, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;270, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;36585, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;810, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp; 328455, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2430, sum= &amp;nbsp; &amp;nbsp; &amp;nbsp;2953665, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7290, sum= &amp;nbsp; &amp;nbsp; 26575695, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21870, sum= &amp;nbsp; &amp;nbsp;239159385, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;65610, sum= &amp;nbsp;-2142598441, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; 196830, sum= &amp;nbsp;-2103713615, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp; 590490, sum= &amp;nbsp;-1754143841, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp;1771470, sum= &amp;nbsp; 1390803145, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; &amp;nbsp;5314410, sum= &amp;nbsp; -372987993, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; 15943230, sum= &amp;nbsp; &amp;nbsp;922132129, dt= &amp;nbsp; &amp;nbsp; 0no= &amp;nbsp; &amp;nbsp; 47829690, sum= &amp;nbsp; -338575121, dt= &amp;nbsp; &amp;nbsp; 1上面的時間 1, 乘以 3, 為何是 0, ???no= &amp;nbsp; &amp;nbsp;143489070, sum= &amp;nbsp; 1104302137, dt= &amp;nbsp; &amp;nbsp; 0上面的時間 0, 乘以 3, 為何是 2, ???no= &amp;nbsp; &amp;nbsp;430467210, sum= &amp;nbsp; &amp;nbsp;918317431, dt= &amp;nbsp; &amp;nbsp; 2no= &amp;nbsp; 1291401630, sum= &amp;nbsp;-1616479343, dt= &amp;nbsp; &amp;nbsp; 5Press any key to continue#endif// ----------------------------------------------#include &amp;lt;time.h&amp;gt;#include &amp;lt;math.h&amp;gt;#include &amp;lt;stdio.h&amp;gt;void main(){	int no, t1, t2, sum, i;		no= 10;	while (no &amp;gt; 0) {		t1= time(NULL);				sum= 0;		for (i=1;i&amp;lt;=no;i++) {			sum+= i;		}				t2= time(NULL);		printf(&quot;no= %12d, sum= %12d, dt= %5d\n&quot;, no, sum, (t2 - t1));				no*= 3;// 為何不是 乘以2, ...	}}// end of main()因為，電腦使用 二進位，累乘以 2, 會得到一些 奇怪的結果，有興趣的，可以自己 試試看，。。。 </description>
		<pubDate>Mon, 15 Nov 2010 11:06:31 +0800</pubDate>
	</item>
	<item>
		<title>int 整數型別的最大值和最小值</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3406</link>
		<description>#if 0n= 2147483647, m= -2147483648請按任意鍵繼續 . . .目前的 int 所能夠表示的 最大整數為2147483647,這個數字加一，會變成 -2147483648.這是因為電腦的內部，使用二的補數來表示 負整數的關係。詳細，請繼續參考 二的補數#endif#include &amp;lt;stdlib.h&amp;gt;#include &amp;lt;stdio.h&amp;gt;int main(){	int n, m;		n= 10;	m= n + 1;// m &amp;gt; n		while (m &amp;gt; n) {		n++;		m= n + 1;	}		printf(&quot;n= %d, m= %d\n&quot;, n, m);	system(&quot;pause&quot;);		return 0;} </description>
		<pubDate>Sat, 13 Nov 2010 08:21:30 +0800</pubDate>
	</item>
	<item>
		<title>這個C語言程式，可以叫AutoCAD自動畫圖</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3396</link>
		<description>底下這個程式，讀 excel 產生的 text file,使用 空格分離 不同欄位。產生 AutoCAD script file,即可 教AutoCAD 自動產生圖形物件#include &quot;stdafx.h&quot;#include &amp;lt;process.h&amp;gt;// --------------------------------------------------------int main(int argc, char* argv[]){&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILE *f1, *f2;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// open the input and output file&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((f1= fopen(&quot;book2a.txt&quot;, &quot;rt&quot;)) == NULL) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf(&quot;\n *** error of fopen() of f1\n&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;system(&quot;pause&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit(1);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((f2= fopen(&quot;T0435.scr&quot;, &quot;wt&quot;)) == NULL) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf(&quot;\n *** error of fopen() of f2\n&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;system(&quot;pause&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit(1);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf(&quot;\n OK for fopen() of f1 and f2, at 04:37\n&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;system(&quot;pause&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// ------------------------------------------&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// read the data from file&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int ct= -1, no, i;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;double x[100], y[100];&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (!feof(f1)) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ct++;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;no= fscanf(f1, &quot;%lf %lf&quot;, &amp;amp;x[ct], &amp;amp;y[ct]);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (no != 2) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ct--;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}// end of while&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf(f2, &quot;spline\n&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (i=0;i&amp;lt;=ct;i++) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;printf(&quot;%5d, %10.6lf, %10.6lf\n&quot;, i, x[i], y[i]);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf(f2, &quot;%.6lf,%.6lf\n&quot;, x[i], y[i]);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf(f2, &quot;\n\n\n&quot;);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fclose(f1);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fclose(f2);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0;} </description>
		<pubDate>Thu, 11 Nov 2010 16:48:28 +0800</pubDate>
	</item>
	<item>
		<title>C 的 &quot;hello, world!&quot;</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3364</link>
		<description>#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;int main(void){&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&quot;hello, world!\n&quot;);	system(&quot;pause&quot;);	&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;} </description>
		<pubDate>Wed, 10 Nov 2010 08:14:27 +0800</pubDate>
	</item>
	<item>
		<title>draw a arc by CDR, C:圓心，D:方向, R:半徑</title>
		<link>http://sites.xms.com.tw/board.php?courseID=151&amp;f=doc&amp;cid=3347</link>
		<description>(defun dtor(d1 / )&amp;nbsp;&amp;nbsp;(* (/ d1 180.0) pi)&amp;nbsp;&amp;nbsp;); end of dtor(); -----------------------------------------------; draw a arc by CDR, C:圓心，D:方向, R:半徑(defun c:arc-cdr( / pc p1 t1 t2 t3 p2 p3)&amp;nbsp;&amp;nbsp;(setq pc (getpoint &quot;\n 弧的圓心: &quot;))&amp;nbsp;&amp;nbsp;(setq p1 (getpoint &quot;\n 大概的方向: &quot;))&amp;nbsp;&amp;nbsp;(setq t1 (angle pc p1))&amp;nbsp;&amp;nbsp;(setq r1 (getdist &quot;\n 輸入兩點 決定半徑: &quot;))&amp;nbsp;&amp;nbsp;(setq t2 (+ t1 (dtor 15.0)))&amp;nbsp;&amp;nbsp;(setq t3 (- t1 (dtor 15.0)))&amp;nbsp;&amp;nbsp;(setq p2 (polar pc t3 r1))&amp;nbsp;&amp;nbsp;(setq p3 (polar pc t2 r1))&amp;nbsp;&amp;nbsp;(setq p1 (polar pc t1 r1))&amp;nbsp;&amp;nbsp;(command &quot;arc&quot; p2 p1 p3)&amp;nbsp;&amp;nbsp;(princ)&amp;nbsp;&amp;nbsp;); end of c:arc-cdr </description>
		<pubDate>Tue, 09 Nov 2010 11:06:43 +0800</pubDate>
	</item>
	</channel>
	</rss>
