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

Commit

Permalink
Merge branch 'main' of github.com:NMLT-NTTMK-K18/7-200-wecode
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinNitroG committed Oct 26, 2023
2 parents 0a1f7ed + 6be52c7 commit 3d4fb4a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 58 deletions.
52 changes: 12 additions & 40 deletions Problem_007/7_003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,32 @@ const int MAX_SIZE = 100;
const int MAXR = 100;
const int MAXC = 100;

bool isFrobeniusMatrix(float matrix[MAX_SIZE][MAX_SIZE], int size)
{
int countNonZeroColumns = 0;

for (int i = 0; i < size; i++)
if (matrix[i][i] != 1)
return false;
for (int i = 0; i < size; i++)
for (int j = 0; j < size; j++)
if (i < j && matrix[i][j] != 0)
return false;
bool isMaTranDonVi(int matrix[MAX_SIZE][MAX_SIZE], int size);
void NhapMaTran(int matrix[MAX_SIZE][MAX_SIZE], int &size);

void NhapMaTran(int matrix[MAX_SIZE][MAX_SIZE], int &size)
{
cin >> size;
for (int i = 0; i < size; i++)
{
int k = 0;
for (int j = 0; j < size; j++)
{
if (j > i && matrix[j][i] != 0)
k++;
cin >> matrix[i][j];
}
if (k != 0)
countNonZeroColumns++;
}
if (countNonZeroColumns > 1)
return false;
return true;
}

void NhapMaTran(float matrix[MAX_SIZE][MAX_SIZE], int size)
bool isMaTranDonVi(int matrix[MAX_SIZE][MAX_SIZE], int size)
{
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
cin >> matrix[i][j];
if ((i == j && matrix[i][j] != 1) || (i != j && matrix[i][j] != 0))
{
return false;
}
}
}
}

int main()
{
float a[MAXR][MAXC];
int n;
cin >> n;
int m;
cin >> m;
NhapMaTran(a, n);
if (isFrobeniusMatrix(a, n))
{
cout << "Yes";
}
else
{
cout << "No";
}
return 0;
return true;
}
10 changes: 7 additions & 3 deletions docs/UnworkedProject.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## UNWORKED PROJECTS

List các file chưa làm:

### PROBLEM_006

1. [6_004](../Problem_006/6_004.cpp)
2. [6_007](../Problem_006/6_007.cpp)
3. [7_002](../Problem_007/7_002.cpp)
4. [7_007](../Problem_007/7_007.cpp)

### PROBLEM_007

1. [7_002](../Problem_007/7_002.cpp)
2. [7_007](../Problem_007/7_007.cpp)
34 changes: 19 additions & 15 deletions docs/WorkedProject.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
## WORKED PROJECTS

List các file đã làm:

### PROBLEM_006

1. [6_001](../Problem_006/6_001.cpp)
1. [6_002](../Problem_006/6_002.cpp)
1. [6_003](../Problem_006/6_003.cpp)
1. [6_005](../Problem_006/6_005.cpp)
1. [6_006](../Problem_006/6_006.cpp)
1. [6_008](../Problem_006/6_008.cpp)
1. [6_009](../Problem_006/6_009.cpp)
1. [6_010](../Problem_006/6_010.cpp)
2. [6_002](../Problem_006/6_002.cpp)
3. [6_003](../Problem_006/6_003.cpp)
4. [6_005](../Problem_006/6_005.cpp)
5. [6_006](../Problem_006/6_006.cpp)
6. [6_008](../Problem_006/6_008.cpp)
7. [6_009](../Problem_006/6_009.cpp)
8. [6_010](../Problem_006/6_010.cpp)

### PROBLEM_007

1. [7_001](../Problem_007/7_001.cpp)
1. [7_003](../Problem_007/7_003.cpp)
1. [7_004](../Problem_007/7_004.cpp)
1. [7_005](../Problem_007/7_005.cpp)
1. [7_006](../Problem_007/7_006.cpp)
1. [7_008](../Problem_007/7_008.cpp)
1. [7_009](../Problem_007/7_009.cpp)
1. [7_010](../Problem_007/7_010.cpp)
2. [7_003](../Problem_007/7_003.cpp)
3. [7_004](../Problem_007/7_004.cpp)
4. [7_005](../Problem_007/7_005.cpp)
5. [7_006](../Problem_007/7_006.cpp)
6. [7_008](../Problem_007/7_008.cpp)
7. [7_009](../Problem_007/7_009.cpp)
8. [7_010](../Problem_007/7_010.cpp)

0 comments on commit 3d4fb4a

Please sign in to comment.