Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<locale.h>
- #include <time.h>
- #pragma warning(disable:4996)
- #define N 5
- #define M 5
- int main(void)
- {
- setlocale(LC_ALL, "Russian");
- int arr[N][M], i, j, max;
- srand(time(NULL));
- for (i = 0; i < N; i++) {
- for (j = 0; j < M; j++) {
- arr[i][j] = rand() % 256;
- printf(" |%3d| ", arr[i][j]);
- }
- printf("\n");
- }
- for (j = 0; j < M; j++)
- printf(" ----- ");
- printf("\n");
- for (i = 0; i < N; i++) {
- max = 0;
- for (j = 0; j < M; j++)
- if (arr[i][j] > max)
- max = arr[i][j];
- printf(" %3d ", max);
- }
- printf("\n");
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement