Skip to content

Instantly share code, notes, and snippets.

@WindAzure
Last active August 4, 2018 17:40
Show Gist options
  • Save WindAzure/8dd1ef845c9e595d65e4d308652d53cc to your computer and use it in GitHub Desktop.
Save WindAzure/8dd1ef845c9e595d65e4d308652d53cc to your computer and use it in GitHub Desktop.
algorithm exercise
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
int a, b, c;
while (~scanf("%d%d%d", &a, &b, &c))
{
if (b >= c)
{
swap(b, c);
}
if (a >= c)
{
swap(a, c);
}
if (a >= b)
{
swap(a, b);
}
printf("%d %d %d\n", a, b, c);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment