A, B, C three numbers, and arrange them in size size

xiaoxiao2021-03-06  59

/ * Topic requirements are: given three numbers of A, B, C, printed them in size size * / # include #define u (a, b, t) ((A> b) (((T = a) || 1)? ((A = b) || 1)? (B = t): 0): 0): 0) / * Ascending * / # define d (A, B, T) (((((((((t = a) || 1)? ((A = b) || 1)? (B = t): 0): 0): 0) / * Descendment * / # define foo (a, b, c, t, f) (f ## (a, b, t) || 1)? (F ## (a, c, t) || 1)? F ## (B, C, T): 0: 0INT Main (void) {INT A = 45, B = 28, C = 42; int TEMP; FOO (A, B, C, TEMP, D); // a, b , c is data, TEMP is the exchange, D represents descending order, u represents ascending order Printf ("/ ND:% D,% D,% D / N", A, B, C); FOO (A, B, C) , TEMP, U); Printf ("/ Nu:% D,% D,% D / N", A, B, C); return 0;}

转载请注明原文地址:https://www.9cbs.com/read-117855.html

New Post(0)