当前位置:网站首页>C language: comprehensive application of if, def and ifndef
C language: comprehensive application of if, def and ifndef
2022-07-06 21:34:00 【Nianchi ichthyology programming】
#include <stdio.h>
#define MAX
#define MAXIMUM(x,y) (x>y)?x:y
#define MINIMUM(x,y) (x>y)?y:x
int main()
{
int a = 10 , b = 20;
#ifdef MAX
printf(" The bigger number is :%d\n",MAXIMUM(a,b));
#else
printf(" The smaller number is :%d\n",MINIMUM(a,b));
#endif
#ifdef MIN
printf(" The smaller number is :%d\n",MINIMUM(a,b));
#else
printf(" The bigger number is :%d\n",MAXIMUM(a,b));
#endif
#undef MAX
#ifdef MAX
printf(" The bigger number is :%d\n",MAXIMUM(a,b));
#else
printf(" The smaller number is :%d\n",MINIMUM(a,b));
#endif
#define MIN
#ifndef MIN
printf(" The smaller number is :%d\n",MINIMUM(a,b));
#else
printf(" The bigger number is :%d\n",MAXIMUM(a,b));
#endif
return 0;
}
Running results :
The bigger number is :20
The bigger number is :20
The smaller number is :10
The bigger number is :20
边栏推荐
- ACdreamoj1110(多重背包)
- Fzu 1686 dragon mystery repeated coverage
- 2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
- What's the best way to get TFS to output each project to its own directory?
- Forward maximum matching method
- R3live notes: image processing section
- How to implement common frameworks
- 在最长的距离二叉树结点
- 【力扣刷题】32. 最长有效括号
- C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set
猜你喜欢
【力扣刷题】一维动态规划记录(53零钱兑换、300最长递增子序列、53最大子数组和)
Is this the feeling of being spoiled by bytes?
uni-app App端半屏连续扫码
Set up a time server
2017 8th Blue Bridge Cup group a provincial tournament
麦趣尔砸了小众奶招牌
【论文解读】用于白内障分级/分类的机器学习技术
Z function (extended KMP)
The biggest pain point of traffic management - the resource utilization rate cannot go up
[MySQL] trigger
随机推荐
Redistemplate common collection instructions opsforset (V)
JS learning notes OO create suspicious objects
MySQL - transaction details
@Detailed differences among getmapping, @postmapping and @requestmapping, with actual combat code (all)
Binary tree node at the longest distance
3D人脸重建:从基础知识到识别/重建方法!
el-table表格——sortable排序 & 出现小数、%时排序错乱
string的底层实现
js中,字符串和数组互转(一)——字符串转为数组的方法
Acdreamoj1110 (multiple backpacks)
Fzu 1686 dragon mystery repeated coverage
JS traversal array and string
启动嵌入式间:资源有限的系统启动
Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
50个常用的Numpy函数解释,参数和使用示例
[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)
guava: Multiset的使用
Dialogue with Jia Yangqing, vice president of Alibaba: pursuing a big model is not a bad thing
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
uni-app App端半屏连续扫码