虫虫首页|资源下载|资源专辑|精品软件
登录|注册

my_include

  • C++完美演绎 经典算法 如 /* 头文件:my_include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.141

    C++完美演绎 经典算法 如 /* 头文件:my_include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.1415926 /* 宏常量,在稍后章节再详解 */ #define circle(radius) (PI*radius*radius) /* 宏函数,圆的面积 */ /* 将比较数值大小的函数写在自编include文件内 */ 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("由小至大排序之后的结果:%d %d %d\n", a, b, c) } 程序执行结果: 由小至大排序之后的结果:1 2 3 可将内建函数的include文件展开在自编的include文件中 圆圈的面积是=201.0619264

    标签: my_include include define 3.141

    上传时间: 2014-01-16

    上传用户:epson850