14.3练习题1
(a)
#include<stdio.h>
#define N(x) (x*x*x)
int main()
{
int x;
printf("请输入x的值: ");
scanf("%d",&x);
printf("x的立方是%d",N(x));
}
或者
#include<stdio.h>
#define N (x*x*x)
int main()
{
int x;
printf("请输入x的值: ");
scanf("%d",&x);
printf("x的立方是%d",N);
}
(c)
#include<stdio.h>
#define N(x,y) ((x*y)<100?1:0)
int main()
{
int x,y;
printf("请输入x的值: ");
scanf("%d",&x);
printf("请输入y的值: ");
scanf("%d",&y);
printf("输出是%d",N(x,y));
}