当前位置:网站首页>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
边栏推荐
- First batch selected! Tencent security tianyufeng control has obtained the business security capability certification of the ICT Institute
- 启动嵌入式间:资源有限的系统启动
- 袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
- 中国白酒的5场大战
- Numpy download and installation
- JS学习笔记-OO创建怀疑的对象
- [interpretation of the paper] machine learning technology for Cataract Classification / classification
- js之遍历数组、字符串
- This year, Jianzhi Tencent
- MySQL - 事务(Transaction)详解
猜你喜欢
Seven original sins of embedded development
It's not my boast. You haven't used this fairy idea plug-in!
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
uni-app App端半屏连续扫码
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
抖音将推独立种草App“可颂”,字节忘不掉小红书?
Sequoia China, just raised $9billion
Is it profitable to host an Olympic Games?
[in depth learning] pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
The biggest pain point of traffic management - the resource utilization rate cannot go up
随机推荐
ROS error: could not find a package configuration file provided by "move_base“
Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
In JS, string and array are converted to each other (II) -- the method of converting array into string
C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set
Word bag model and TF-IDF
Forward maximum matching method
14年本科毕业,转行软件测试,薪资13.5K
This year, Jianzhi Tencent
SDL2来源分析7:演出(SDL_RenderPresent())
50个常用的Numpy函数解释,参数和使用示例
The biggest pain point of traffic management - the resource utilization rate cannot go up
爬虫实战(五):爬豆瓣top250
Comparison between multithreaded CAS and synchronized
JPEG2000 matlab source code implementation
Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
El table table - get the row and column you click & the sort of El table and sort change, El table column and sort method & clear sort clearsort
First batch selected! Tencent security tianyufeng control has obtained the business security capability certification of the ICT Institute
Dialogue with Jia Yangqing, vice president of Alibaba: pursuing a big model is not a bad thing
SQL:存储过程和触发器~笔记