Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int main(int argc, char * argv[]) {
- int n;
- scanf("%d", &n);
- int a[n][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- scanf("%d", &a[i][j]);
- }
- }
- int b[n][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- scanf("%d", &b[i][j]);
- }
- }
- int T[n][n];
- for(int j = 0; j < n; j++) {
- for(int i = 0; i < n; i++) {
- T[j][i] = a[i][j];
- }
- }
- int brojac =0 ;
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- if(T[i][j] != b[i][j]) {
- brojac++;
- }
- }
- }
- if(brojac == 0) {
- printf("Moze od transponirana da se dobie matricata B\n");
- }
- else {
- printf("Se razlikuva vo %d\n", brojac);
- }
- }
- /*
- 4
- 1 2 10 0
- 7 2 3 1
- 6 0 5 4
- 4 1 0 1
- 1 7 6 0
- 2 2 0 1
- 10 3 5 0
- 0 1 4 7
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement