126
|
1 extern int printf(const char*, ...);
|
16
|
2
|
|
3 int test01(int a, double b, int *c){
|
|
4 return a+b- *c;
|
|
5 }
|
|
6
|
|
7 int test(int *a, double b){
|
|
8 int c;
|
|
9 c = *a*b + 10;
|
|
10 printf("a = %x, *a = %d, b = %d\n", a, *a, b);
|
|
11 *a = test01( *a+b, 0.02, &c);
|
|
12 return *a+b;
|
|
13 }
|
|
14
|
|
15
|
|
16 int test02(int a, int b){
|
|
17 int i,sum=0;
|
|
18 i = a;
|
|
19 while ( i <= b ) {
|
|
20 sum += i;
|
|
21 i++;
|
|
22 }
|
|
23 return sum - a*b;
|
|
24 }
|
|
25
|
|
26 int main(int argc, char **argv){
|
|
27 int a=10;
|
|
28
|
|
29 printf("= %d\n", test02(0, 10));
|
|
30 test( &a, 10.1);
|
|
31 return 0;
|
|
32 }
|
|
33
|
|
34
|