Home > Back-end >  C program design a program of the book, the result is a random 8 digits
C program design a program of the book, the result is a random 8 digits

Time:11-10

#include
Int main ()
{void exchange (int * q1, q2 int * and an int * q3);
Int a, b, c, * (p1, p2, p3 is *;
Printf_s (" both please enter three Numbers: ");
Scanf_s (" % d, % d, % d ", & amp; A, & amp; B, & amp; C);
P1=& amp; a;
The p2=& amp; b;
P3=& amp; c;
Exchange (p1, p2, p3);
Printf_s (" The order is: % d, % d, % d \ n ", & amp; A, & amp; B, & amp; C);
return 0;
}
Void exchange (int * q1, q2 int * and an int * q3)
{void swap (int * pt1, int * pt2) that;
If (* q1 & lt; * q2) swap (q1, q2);
If (* q1 & lt; * q3) swap (q1, q3);
If (* q2 & lt; * q3) swap (q2, q3);
}
Void swap (int * pt1, int * pt2) that
{int temp.
Temp=* pt1;
* pt1=* pt2;
* pt2=temp;
}



The above procedure is
Both please enter three Numbers: 5,7,9
The order is: 14416608144659 6144658
Please press any key to continue...
What's the matter, please

CodePudding user response:

Printf_s (" The order is: % d, % d, % d \ n ", a, b, c);
  • Related