当前位置:网站首页>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
边栏推荐
- [MySQL] trigger
- [sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
- Yyds dry inventory run kubeedge official example_ Counter demo counter
- Replace Internet TV set-top box application through digital TV and broadband network
- 50个常用的Numpy函数解释,参数和使用示例
- Seven original sins of embedded development
- Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
- 缓存更新策略概览(Caching Strategies Overview)
- guava:创建immutableXxx对象的3种方式
- 抖音将推独立种草App“可颂”,字节忘不掉小红书?
猜你喜欢
It's not my boast. You haven't used this fairy idea plug-in!
50个常用的Numpy函数解释,参数和使用示例
Aiko ai Frontier promotion (7.6)
[Li Kou brush questions] 32 Longest valid bracket
[MySQL] basic use of cursor
Internet News: Geely officially acquired Meizu; Intensive insulin purchase was fully implemented in 31 provinces
2022菲尔兹奖揭晓!首位韩裔许埈珥上榜,四位80后得奖,乌克兰女数学家成史上唯二获奖女性
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
Absolute primes (C language)
20220211 failure - maximum amount of data supported by mongodb
随机推荐
Internet News: Geely officially acquired Meizu; Intensive insulin purchase was fully implemented in 31 provinces
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
快讯:飞书玩家大会线上举行;微信支付推出“教培服务工具箱”
Data Lake (VIII): Iceberg data storage format
Why does MySQL index fail? When do I use indexes?
C语言:#if、#def和#ifndef综合应用
Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
[MySQL] trigger
[interpretation of the paper] machine learning technology for Cataract Classification / classification
Guava: three ways to create immutablexxx objects
Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
Technology sharing | packet capturing analysis TCP protocol
麦趣尔砸了小众奶招牌
Sequoia China, just raised $9billion
966 minimum path sum
R language for text mining Part4 text classification
袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
El table table - sortable sorting & disordered sorting when decimal and% appear
After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers
In JS, string and array are converted to each other (I) -- the method of converting string into array