#define N 2+2
void main(void)
{
int a = N * N;
printf("%d\n" , a );
}
#include<stdio.h>
#define area(x) ((x)*(x))
int main(void)
{
int s = area(3 + 3);
printf("s = %d\n" , s);
return 0;
}
#include<stdio.h>
#define area(x) x*x
int main(void)
{
int s = area(3 + 3);
printf("s = %d\n" , s);
return 0;
}
[Linux@centos-64-min exercise]$ cat mul.c
#include <stdio.h>
int mult(int x , int y )
{
int result = x * y;
return result;
}
[Linux@centos-64-min exercise]$ cat mul.c
#include <stdio.h>
int mult(int x , int y )
{
int result = x * y;
return result;
}
[Linux@centos-64-min exercise]$ cat try.c
#include <stdio.h>
int mult(int x , int y); /*两个数字相乘的函数的声明*/
#define square_area(str , x) mult(x , x) /*封装成一个求正方形面积的函数*/
#define rectangle_area(str , x , y) mult(x , y) /*封装成一个求长方形面积的函数*/
/*上面那些函数声明和宏定义按照比较规范的书写,本来应该放在一个头文件里面的,这里为了说明问题就简单放在函数里了*/
int main(void)
{
int s = 0;
s = square_area("This is the area of the square" , 3);
printf("This is the area of the square : s = %d\n" , s);
s = rectangle_area("This is the area of the rectangle" , 3 ,4);
printf("This is the area of the rectangle : s = %d\n" , s);
return 0;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有