C++完美演繹 經(jīng)典算法 如 /* 頭文件:my_Include.h */ #include <stdio.h> /* 展開C語言的內(nèi)建函數(shù)指令 */ #define PI 3.1415926 /* 宏常量,在稍后章節(jié)再詳解 */ #define circle(radius) (PI*radius*radius) /* 宏函數(shù),圓的面積 */ /* 將比較數(shù)值大小的函數(shù)寫在自編include文件內(nèi) */ int show_big_or_small (int a,int b,int c) { int tmp if (a>b) { tmp = a a = b b = tmp } if (b>c) { tmp = b b = c c = tmp } if (a>b) { tmp = a a = b b = tmp } printf("由小至大排序之后的結(jié)果:%d %d %d\n", a, b, c) } 程序執(zhí)行結(jié)果: 由小至大排序之后的結(jié)果:1 2 3 可將內(nèi)建函數(shù)的include文件展開在自編的include文件中 圓圈的面積是=201.0619264
標(biāo)簽:
my_Include
include
define
3.141
上傳時間:
2014-01-17
上傳用戶:epson850