当前位置:网站首页>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
边栏推荐
- Hill | insert sort
- js之遍历数组、字符串
- 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
- 字符串的使用方法之startwith()-以XX开头、endsWith()-以XX结尾、trim()-删除两端空格
- Why does MySQL index fail? When do I use indexes?
- 【滑动窗口】第九届蓝桥杯省赛B组:日志统计
- Three schemes of SVM to realize multi classification
- Michael smashed the minority milk sign
- Description of web function test
- ACdreamoj1110(多重背包)
猜你喜欢
红杉中国,刚刚募资90亿美元
guava:Collections. The collection created by unmodifiablexxx is not immutable
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
【滑动窗口】第九届蓝桥杯省赛B组:日志统计
ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
[redis design and implementation] part I: summary of redis data structure and objects
【力扣刷题】一维动态规划记录(53零钱兑换、300最长递增子序列、53最大子数组和)
Sequoia China, just raised $9billion
039. (2.8) thoughts in the ward
随机推荐
【力扣刷题】32. 最长有效括号
2017 8th Blue Bridge Cup group a provincial tournament
[interpretation of the paper] machine learning technology for Cataract Classification / classification
在Pi和Jetson nano上运行深度网络,程序被Killed
14年本科毕业,转行软件测试,薪资13.5K
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
How do I remove duplicates from the list- How to remove duplicates from a list?
R3live notes: image processing section
Torch Cookbook
JS traversal array and string
Fastjson parses JSON strings (deserialized to list, map)
js通过数组内容来获取数组下标
在最长的距离二叉树结点
Is this the feeling of being spoiled by bytes?
for循环中break与continue的区别——break-完全结束循环 & continue-终止本次循环
In JS, string and array are converted to each other (II) -- the method of converting array into string
JPEG2000-Matlab源码实现
js之遍历数组、字符串
string的底层实现
The biggest pain point of traffic management - the resource utilization rate cannot go up