Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <conio.h>
  4. #include <locale.h>
  5. #include <math.h>
  6.  
  7. int main()
  8. {
  9.     int m[5];
  10.     int i, s = 0, d,p;
  11.     for (i = 0; i<5; i++)
  12.     {
  13.         scanf("%d", &m[i]);
  14.     }
  15.     for (i = 0; i < 4; i++)
  16.     {
  17.         for (s = 0; s < 4-i; s++)
  18.         {
  19.             if (m[s]>m[s + 1])
  20.             {
  21.                 d = m[s];
  22.                 m[s] = m[s + 1];
  23.                 m[s + 1] = d;
  24.             }
  25.         }
  26.     }
  27.     printf("%d", m[3]);
  28. _getch();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement