博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c语言中的#ifdef和#ifndef
阅读量:4635 次
发布时间:2019-06-09

本文共 736 字,大约阅读时间需要 2 分钟。

#include "stdio.h"

#include "conio.h"
#define MAX
#define MAXIMUM(x,y) (x>y)?x:y
#define MINIMUM(x,y) (x>y)?y:x
void main()
{
int a=10,b=20;
#ifdef MAX
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#else
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#endif
#ifndef MIN
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#else
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#endif
#undef MAX
#ifdef MAX
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#else
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#endif
#define MIN
#ifndef MIN
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#else
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#endif
getch();
}

转载于:https://www.cnblogs.com/zhaoheng/p/4322214.html

你可能感兴趣的文章
Python Day26:多态、封装、内置函数:__str__、__del__、反射(反省)、动态导入模块...
查看>>
Android 基础 一 AndroidManifest.xml
查看>>
Python学习笔记17:标准库之数学相关(math包,random包)
查看>>
洛谷 P1387 最大正方形
查看>>
AngularJS 指令
查看>>
acdream LCM Challenge (最小公倍数)
查看>>
iptables-save和iptables-restore
查看>>
C语言访问网页
查看>>
Dynamics CRM 导入导出数据
查看>>
Docker基本命令汇总
查看>>
ucgui下制作漂亮按键
查看>>
(一)Java基础巩固
查看>>
静态代码块
查看>>
FhqTreap的区间翻转
查看>>
九度 1553:时钟(模拟题)
查看>>
一、动态添加表格
查看>>
把对像生成json并存储到文件
查看>>
LoadLibrary加载动态库失败
查看>>
算法之递归(3)- 链表操作
查看>>
Linux Supervisor的安装与使用入门
查看>>