Advertisement
Polnochniy

Untitled

Nov 21st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int N = 5;
  4.  
  5. int main()
  6. {
  7. setlocale(LC_ALL, "Rus");
  8. int a[N], min;
  9. cout << "Введите элементы массива . Найдите минимальный элемент" << endl;
  10. for (int i = 0; i < N; i++)
  11. {
  12. cin >> a[i];
  13. }
  14. min = a[0];
  15. for (int i = 1; i < N; i++)
  16. {
  17. if (min > a[i])
  18. {
  19. min = a[i];
  20. }
  21. }
  22. cout << "Min: " << min << endl;
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement