ar[j]) { int temp = ar[i]; ar[i] = ar[j]; ar[...">
for(int i = 0; i < n - 1; i++ ) for(int j = i + 1; j < n; j++) if(ar[i] > ar[j]) { int temp = ar[i]; ar[i] = ar[j]; ar[j] = temp; }
ar[i] ^= ar[j] ^= ar[i] ^= ar[j];
(ar[i] > ar[j]) ? ar[i] ^= ar[j] ^= ar[i] ^= ar[j] : 0;
for(int i = 0, j = 0; j < n ? 1 : i < n - 1; j = j < n ? ((ar[i] > ar[j] ? ar[i] ^= ar[j] ^= ar[i] ^= ar[j] : 0), ( j + 1 )) : ++i // j=n, );
Source: https://habr.com/ru/post/144510/
All Articles