4 hours of homework

Source: Internet
Author: User

# Include <stdio. h>
Int main (viod)
Int A, B, C, Max, Min, mid, stemp1, stemp2, stemp3;
Printf ("Enter three numbers, separated by commas ");
Scanf ("% d, % d, % d", & A, & B, & C );
Max =;
Max = max> B? MAX: B;
Max = max> C? MAX: C;

Min = C;
Min = min <B? Min: B;
Min = min <? Min:;

// Mid = B <(A <C? A: C )? (A <C? A: C): B;
Stemp1 = A> B? A: B; // The value of A and B.
Stemp2 = A> C? A: C; // large value in a and c
Stemp3 = B> C? B: C; // a large value in B and C

Mid = stemp3 <(stemp1 <stemp2? Stemp1: stemp2 )? Stemp3 :( stemp1 <stemp2? Stemp1: stemp2); // the smallest of the three

Printf ("% d, % d, the maximum number of % d \ n", a, B, c, max );
Printf ("% d, % d, % d: % d \ n", a, B, c, min );
Printf ("% d, % d, % d in the middle of the number: % d \ n", a, B, c, mid );


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.