Advertisement
Rehan_Rahman26

Uri 1042 (Simple Sort)

May 23rd, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int a,b,c,t,i,j,k;
  5.     scanf("%d %d %d",&a,&b,&c);
  6.    
  7.     i=a;
  8.     j=b;
  9.     k=c;
  10.         if(a<b){
  11.             t=a;
  12.             a=b;
  13.             b=t;
  14.         }
  15.         if(b<c){
  16.             t=b;
  17.             b=c;
  18.             c=t;
  19.         }
  20.         if(c<a){
  21.             t=c;
  22.             c=a;
  23.             a=t;
  24.         }
  25.     printf("%d\n%d\n%d\n",a,b,c);
  26.     printf("\n");
  27.    
  28.     printf("%d\n%d\n%d\n",i,j,k);
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement