Branch-05. Use the balance to find the ball

Source: Internet
Author: User

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}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.