Skip to content

Instantly share code, notes, and snippets.

@daniilgri
Created December 7, 2018 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniilgri/6658af337f3cc057d0791e48284292ba to your computer and use it in GitHub Desktop.
Save daniilgri/6658af337f3cc057d0791e48284292ba to your computer and use it in GitHub Desktop.
#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