Advertisement
Guest User

assim

a guest
Mar 3rd, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int v[3] = [{1,3,2};
  2. int ax;
  3. if((v[0]<v[1]) && (v[0] < v[2]) && (v[2] > v[1])){
  4.     ax = v[1];
  5.     v[1] = v[2];
  6.     v[2] = ax;
  7. }
  8. if((v[1] < v[0]) && (v[1] < v[2])){
  9.     if(v[0] < v[2]){
  10.         ax = v[0];
  11.         v[0] = v[1];
  12.         v[1] = ax;
  13.     } else {
  14.         ax = v[0];
  15.         v[0] = v[2];
  16.         v[2] = ax;
  17.     }
  18. }
  19. if((v[2] < v[0]) && (v[2] < v[1]) && (v[0] > v[1])){
  20.     ax = v[1];
  21.     v[1] = v[0];
  22.     v[1] = v[2];
  23.     v[2] = ax;
  24. }
  25. printf("%d - %d - %d\n", v[0], v[1], v[2]);
  26. system("pause");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement