Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sort4(int* a, int* b, int* c, int* d) {
- int taul [4];
- taul [0] = *a;
- taul [1] = *b;
- taul [2] = *c;
- taul [3] = *d;
- int x = 4;
- if (d == NULL) {
- x = 3;
- }
- if (c == NULL) {
- x = 2;
- }
- if (b == NULL) {
- x = 1;
- }
- for (int i=0; i < x - 1; i++) {
- int j = i + 1;
- while (j < x) {
- if (taul[i] > taul[j]){
- int t = taul [i];
- taul [i] = taul [j];
- taul [j] = t;
- j = i + 1;
- }
- j++;
- }
- }
- *a = taul[0];
- *b = taul[1];
- *c = taul[2];
- *d = taul[3];
Add Comment
Please, Sign In to add comment