Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
113
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.  
  4. int main()
  5. {
  6. int mas[5][5];
  7. int mas2[5];
  8. cout << "enter mas: ";
  9. for (int i = 0; i < 5; i++)
  10. {
  11. for (int j = 0; j < 5; j++)
  12. {
  13. cin >> mas[i][j];
  14. }
  15. }
  16. int temp = mas[0][0];
  17. int t = 0;
  18. for (int i = 0; i < 5; i++)
  19. {
  20. for (int j = 0; j < 5; j++)
  21. {
  22. if (temp<mas[i][j])
  23. {
  24. temp = mas[i][j];
  25. t = i;
  26. }
  27. }
  28. }
  29.  
  30. for (int i = 0; i < 5; i++)
  31. {
  32. mas2[i] = mas[t][i];
  33. }
  34. cout << endl;
  35.  
  36. for (int i = 0; i < 5; i++)
  37. {
  38. cout << mas2[i] << '\t';
  39. }
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement