Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Lesson 7 has a few errors
Browse files Browse the repository at this point in the history
  • Loading branch information
truonghoangkhiem committed Nov 2, 2023
1 parent e33ed80 commit 20d65c5
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions Problem_007/7_007.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
#include <iostream>
using namespace std;
#include<iostream>
using namespace std;
#define MAX 16

int main()
void Nhap(float[][MAX], int&, int&);
bool ktDoiXung(float[][MAX], int, int);

int main ()
{
float a[MAX][MAX];
int m,n;
Nhap(a, m, n);
if (m != n)
{
cout << "No";
return 0;
}
if (ktDoiXung(a, m, n))
cout << "Yes";
else
cout << "No";
return 0;
}

void Nhap(float a[][MAX], int& m, int& n)
{
cin >> m;
cin >> n;
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> a[i][j];
}

bool ktDoiXung(float a[][MAX], int m, int n)
{
return 0;
}
if (m != n)
return 0;
for (int i = 0; i < m; i++)
for (int j = i + 1; j < n; j++)
if (a[i][j] != a[j][i])
return 0;
return 1;
}

0 comments on commit 20d65c5

Please sign in to comment.