Advertisement
Polnochniy

Untitled

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