Home > Back-end > Ask bosses, this how should I change, thank you
Ask bosses, this how should I change, thank you
Time:09-24
Code: # include Int main () { Int a [50], [3] b, m, * p * q; P=a; Q=b; Printf (" m: "); The scanf (" % d ", & amp; M); Printf (" a: "); For (p=a; pThe scanf (" % d ", p); Printf (" b: "); The scanf (" % d ", q); For (p=a; pFor (q=b; QIf (* p> * q) * p=* q; } A: printf (" % d ", p); return 0; }
CodePudding user response:
# include Int main () { Int a [50], [3] b, m (0), * p * q; P=a; Q=b; Printf (" m: "); while(! (m> 0 & amp; & M<=47)) The scanf (" % d ", & amp; M); Printf (" a: "); For (p=a; pThe scanf (" % d ", p); Printf (" b: "); For (q=b; Q & lt; B + 3; Q++) The scanf (" % d ", q);
Int temp. For (q=b; QFor (p=a; P & lt; A + m + - b (q); P++) { If (* p & gt;//and then * q) in { Temp=* p; * p=* q; * q=temp; } } * p=temp;//fill out }
Printf (" a: "); for (int i=0; I & lt; M + 3; I++) { Printf (" % d ", a [I]); } return 0; }