Advertisement
noor017

Simple Sort

Jun 7th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.   int A,B,C;
  5.   scanf("%d %d %d",&A,&B,&C);
  6.  
  7.   if(A<B && A<C && B<C)
  8.     {
  9.       printf("%d\n%d\n%d\n",A,B,C);
  10.     }
  11.  
  12.       else if(A<B && A<C && C<B)
  13.   {
  14.       printf("%d\n%d\n%d\n",A,C,B);
  15.   }
  16.       else if(B<A && B<C && C<A)
  17.   {
  18.       printf("%d\n%d\n%d\n",B,C,A);
  19.   }
  20.  
  21.       else if(C<B && C<A && B<A)
  22.   {
  23.       printf("%d\n%d\n%d\n",C,B,A);
  24.   }
  25.       else if(B<A && B<C && A<C)
  26.   {
  27.       printf("%d\n%d\n%d\n",B,A,C);
  28.   }
  29.       else
  30.       printf("%d\n%d\n%d\n",C,A,B);
  31.  
  32.       printf("\n");
  33.       printf("%d\n%d\n%d\n",A,B,C);
  34.   return(0);
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement