更新了文件名。开始了数据结构

This commit is contained in:
lzy
2024-04-14 06:55:53 +08:00
parent 9bc7edbf47
commit 45bcb90c6d
69 changed files with 455 additions and 0 deletions

32
Chapter07/min_max.c Normal file
View File

@@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
int max(int a, int b, int c)
{
int tmp;
tmp = a > b ? a : b;
return tmp > c ? tmp : c;
}
int min(int a, int b, int c)
{
int tmp;
tmp = a < b ? a : b;
return tmp < c ? tmp : c;
}
int dist(int a, int b, int c)
{
return max(a, b, c) - min(a, b, c);
}
int main()
{
int a = 3, b = 5, c = 10;
printf("result = %d\n", dist(a, b, c));
exit(0);
}