Advertisement
it4l0

foto

Dec 13th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.      int x = 4, t = 0, z = 0, aux = 0, aux1 = 0;
  5.      float foto[4];
  6.      for (t = 0; t < 4; ++t)
  7.      {
  8.           scanf("%f", &foto[t]);
  9.      }
  10.      for (t = 0; t < 4; ++t)
  11.      {
  12.           aux = t;
  13.           for (z = t + 1; z < 4; ++z)
  14.           {
  15.                if(foto[z] > foto[aux])
  16.                {
  17.                     aux = z;
  18.                }
  19.           }
  20.           aux1 = foto[t];
  21.           foto[t] = foto[aux];
  22.           foto[aux] = aux1;
  23.      }
  24.      printf("%.2f\n", foto[3]);
  25.      printf("%.2f\n", foto[1]);
  26.      printf("%.2f\n", foto[0]);
  27.      printf("%.2f", foto[2]);
  28.      return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement