79
|
1
|
94
|
2 int
|
|
3 a0(int i);
|
79
|
4
|
|
5 int (*conv)(int);
|
|
6
|
|
7 a0(int i)
|
|
8 {
|
|
9 return i+3;
|
|
10 }
|
|
11
|
|
12 a1(int i)
|
|
13 {
|
|
14 return i-3;
|
|
15 }
|
|
16
|
|
17
|
|
18 a2(int i,int conv(int))
|
|
19 {
|
|
20 return conv(i);
|
|
21 }
|
|
22
|
|
23 a3(int i,int (*conv)(int))
|
|
24 {
|
|
25 return conv(i);
|
|
26 }
|
|
27
|
|
28 a4(int i,int conv(int))
|
|
29 {
|
|
30 return (*conv)(i);
|
|
31 }
|
|
32
|
|
33 a5(int i,int (*conv)(int))
|
|
34 {
|
|
35 return (*conv)(i);
|
|
36 }
|
|
37
|
|
38 main(int ac,char *av[]) {
|
|
39 int j,k;
|
|
40 conv = a0;
|
|
41 j = conv(3);
|
|
42 k = a2(4,a1);
|
|
43 printf("6 1 = %d %d\n",j,k);
|
|
44 k = a3(4,a1);
|
|
45 printf("6 1 = %d %d\n",j,k);
|
|
46 k = a4(4,a1);
|
|
47 printf("6 1 = %d %d\n",j,k);
|
|
48 k = a5(4,a1);
|
|
49 printf("6 1 = %d %d\n",j,k);
|
172
|
50 return 0;
|
79
|
51 }
|