meng@ubuntu:~/exam_0906$ cat -n test.c
1 #include "stdio.h"
2 #define MIN(x,y) (x)<(y)?(x):(y)
3
4 int main(int argc, char *argv[])
5 {
6 int i,j,k;
7
8 i=10;
9 j=15;
10 k=10*MIN(i,j);
11 printf("%d\n",k);
12
13 return 0;
14 }
meng@ubuntu:~/exam_0906$ ./test
15
—————————————————————————————————————————
meng@ubuntu:~/exam_0906$ gcc -o test test.c
meng@ubuntu:~/exam_0906$ cat -n test.c
1 #include "stdio.h"
2 #define MIN(x,y) (x)<(y)?(x):(y)
3
4 int main(int argc, char *argv[])
5 {
6 int i,j,k;
7
8 i=10;
9 j=15;
10 // k=10*MIN(i,j);
11 k=10*(MIN(i,j));
12 printf("%d\n",k);
13
14 return 0;
15 }
meng@ubuntu:~/exam_0906$ ./test
100
—————————————————————————————————————————
meng@ubuntu:~/exam_0906$ gcc -o test test.c
meng@ubuntu:~/exam_0906$ cat -n test.c
1 #include "stdio.h"
2 #define MIN(x,y) ((x)<(y)?(x):(y))
3
4 int main(int argc, char *argv[])
5 {
6 int i,j,k;
7
8 i=10;
9 j=15;
10 k=10*MIN(i,j);
11 printf("%d\n",k);
12
13 return 0;
14 }
meng@ubuntu:~/exam_0906$ ./test
100
没有评论:
发表评论