Skip to content

Instantly share code, notes, and snippets.

@bcho
Created November 11, 2012 12:31
Show Gist options
  • Select an option

  • Save bcho/4054775 to your computer and use it in GitHub Desktop.

Select an option

Save bcho/4054775 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
char c1, c2, c3;
scanf("%c %c %c", &c1, &c2, &c3);
(c1 > c2) ? (c1 ^= c2 ^= c1 ^= c2) : 0,
(c1 > c3) ? (c1 ^= c3 ^= c1 ^= c3) : 0,
(c2 > c3) ? (c2 ^= c3 ^= c2 ^= c3) : 0;
printf("%c %c %c", c1, c2, c3);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment