1/* 2 * B5-branch-05. use the balance to find the ball (10) 3*4 * Created on: May 28, 2014 5*6 * tested 7 */8 9 # include <stdio. h> 10 # include <stdlib. h> 11 12 void compare (int * p_A, int * p_ B, int * p_C) 13 {14 if (* p_A = * p_ B & * p_A! = * P_C) 15 printf ("C \ n"); 16 if (* p_A = * p_C & * p_A! = * P_ B) 17 printf ("B \ n"); 18 if (* p_ B = * p_C & * p_ B! = * P_A) 19 printf ("A \ n"); 20 exit (1); // exit unexpectedly. Normal exit 0 indicates EXIT_SUCCESS, 1 indicates EXIT_FAILURE21} 22 23 int main () 24 {25 void compare (int * p_A, int * p_ B, int * p_C); 26 27 int massA; 28 int massB; 29 int massC; 30 int * p_A = & massA; 31 int * p_ B = & massB; 32 int * p_C = & massC; 33 34 35 scanf ("% I", & massA, & massB, & massC); 36 37 printf ("p_A = % p, p_ B = % p, p_C = % p \ n ", p_A, p_ B, p_C); 38 39 compare (p_A, p_ B, p_C); 40 41 return 0; 42}