/* 2022.5.6*/
/* lethead2.c */
//#include <stdio.h>
//#include <string.h> /* 为 strlen */
//#define NAME "GIGATHINK, INC."
//#define ADDRESS "101 megabuck plaza"
//#define PLACE "megapolis, CA 94904"
//#define WIDTH 40
//#define SPACE ''
//
//void show_n_char(char ch, int num);
//
//int main(void)
//{
// int spaces;
//
// show_n_char('*', WIDTH); /* 用符号常量作为参数 */
// putchar('\n');
// show_n_char( ' ', 12); /* 用符号常量作为参数 */
// printf("%s\n", NAME);
// spaces = (WIDTH - strlen(ADDRESS)) / 2; /* 计算要跳过多少个空格 */
//
// show_n_char( ' ', spaces); /* 用一个变量作为参数*/
// show_n_char('*', WIDTH);
// putchar('\n');
//
// return 0;
//}
//
///* show_n_cahr()函数的定义 */
//void show_n_char(char ch, int num)
//{
// int count;
//
// for (count = 1; count <= num; count++)
// putchar(ch);
//}
/* lesser.c -- 找出两个整数中较小的一个--------------------------------------------------不对 */
//#include <stdio.h>
//int imin(int, int);
//
//int main(void)
//{
// int evi11, evi12;
//
// printf("enter a pair of integers (q to quit): \n");
// while (scanf("%d %d", &evi12) == 2)
// {
// printf("the lesser of %d and %d id %d.\n", evi11, evi12, imin(evi11, evi12));
// printf("enter a pair of integers (q to quit) :\n");
// }
//
// printf("bye.\n");
//
// return 0;
//}
//
//int imin(int n, int m)
//{
// int min;
//
// if (n < m)
// min = n;
// else
// min = m;
//
// return min;
//
//}
/* 错误地使用函数 ----------------------------------------------------------------------不对*/
//#include <stdio.h>
//int imax(); /* 旧式函数声明 */
//
//int main(void)
//{
// printf("the maximun of %d and %d is %d.\n", 3, 5, imax(3));
// printf("the maximun of %d and %d is %d.\n", 3, 5, imax(3.0, 5.0));
//
// return 0;
//}
//
//int imax(n, m)
//int n, m;
//{
// return (n > m ? n : m);
//}
/* proto.c -- 使用函数原型------------------------------------------------------------------不对 */
//#include <stdio.h>
//int imax(int, int); /* 函数原型 */
//int main(void)
//{
// printf("the maximun of %d and %d is %d.\n", 3, 5, imax(3));
// printf("the maximun of %d and %d is %d.\n", 3, 5, imax(3.0, 5.0));
//
// return 0;
//}
//
//int imax(int n, int m)
//{
// return (n > m ? n : m);
//}
/* recur.c -- 递归演示 */
#include <stdio.h>
void up_and_down(int);
int main()
{
up_and_down(1);
return 0;
}
void up_and_down(int n)
{
printf("level %d: n location %p\n", n, &n); /* #1 */
if (n < 4)
up_and_down(n + 1);
printf("LEVEL %d: n location %p\n", n, &n); /* #2 */
}