Created
December 7, 2018 06:41
-
-
Save daniilgri/6658af337f3cc057d0791e48284292ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
#include <iostream> | |
#include <stdlib.h> | |
#include <conio.h> | |
#include <windows.h> | |
int main() | |
{ | |
SetConsoleOutputCP(1251); | |
SetConsoleCP(1251); | |
int n, m; | |
int i, j; | |
printf("Введите n: "); | |
scanf_s("%i", &n); | |
printf("\n"); | |
int matrix[10][10]; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < n; j++) { | |
printf("Введите matrix[%i][%i]: ", i + 1, j + 1); | |
scanf_s("%i", *(matrix + i) + j); | |
} | |
printf("\n"); | |
} | |
int crash = false; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < n; j++) { | |
if (i != j) { | |
if (matrix[i][j] != matrix[j][i]) { | |
printf("Не равно!\n"); | |
crash = true; | |
break; | |
} | |
} | |
} | |
if (crash) { | |
break; | |
} | |
} | |
for (i = 0; i < n; i++) { | |
for (int j = 0; j < n; j++) { | |
printf(" matrix[%i][%i] = %i ", i + 1, j + 1, matrix[i][j]); | |
} | |
printf("\n"); | |
} | |
_getch(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment