#include <iostream> static const int ROW = 10; static const int COL = 10; int main() { unsigned int array[ROW][COL]; srand(0); for (unsigned int i = 0; i < ROW; ++i) { for (unsigned int j = 0; j < COL; ++j) { array[i][j] = rand() % 100; std::cout << array[i][j] << ", "; } std::cout << std::endl; } for (unsigned int i = 0; i < ROW; ++i) { unsigned int max = array[i][0]; for (unsigned int j = 1; j < COL; ++j) { if (max < array[i][j]) { max = array[i][j]; } } std::cout << max << std::endl; } return 0; }
Standard input is empty
83, 86, 77, 15, 93, 35, 86, 92, 49, 21, 62, 27, 90, 59, 63, 26, 40, 26, 72, 36, 11, 68, 67, 29, 82, 30, 62, 23, 67, 35, 29, 2, 22, 58, 69, 67, 93, 56, 11, 42, 29, 73, 21, 19, 84, 37, 98, 24, 15, 70, 13, 26, 91, 80, 56, 73, 62, 70, 96, 81, 5, 25, 84, 27, 36, 5, 46, 29, 13, 57, 24, 95, 82, 45, 14, 67, 34, 64, 43, 50, 87, 8, 76, 78, 88, 84, 3, 51, 54, 99, 32, 60, 76, 68, 39, 12, 26, 86, 94, 39, 93 90 82 93 98 96 84 95 99 94