Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void main(void) {
- int M[6][6];
- int i, j, a;
- for (i = 0; i < 6; i++) {
- for (j = 0; j < 6; j++) {
- printf("Enter element with index [%d|%d]: ", i + 1, j + 1, "\n");
- scanf_s("%d", &a);
- M[i][j] = a;
- }
- }
- printf("Your matrix: \n");
- for (i = 0; i < 6; i++) {
- for (j = 0; j < 6; j++) {
- printf(" %d", M[i][j]);
- }
- printf("\n");
- }
- int num = M[0][0];
- for (i = 0; i < 6; i++) {
- for (j = 0; j < 6; j++) {
- if (M[i][j] >= num) {
- num = M[i][j];
- }
- }
- }
- printf("The biggest number is %d\n", num);
- printf("Indexes of the biggest elements from the matrix:\n");
- for (i = 0; i < 6; i++) {
- for (j = 0; j < 6; j++) {
- if (M[i][j] == num) {
- printf("[%d|%d]\n", i + 1, j + 1);
- }
- }
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement