Untitled
raw download clone
C
views 8
,
size 446 b
#include <stdio.h>
void troca( int *a, int *b)
{
    int aux = *a;
    *a = *b;
    *b = aux;
}
int main()
{
    int x, y, z;
    scanf("%d%d%d", &x,&y,&z);
    if (x > y || x > z)
    {
        if (y < z)
        {
            troca(&x,&y);
        }
        else
        {
            troca(&x,&z);
        }
    }
    if (y > z)
    {
        troca(&y,&z);
    }
    printf("%d\n%d\n%d\n", x, y, z);
    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.