Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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