Skip to content

Commit ac449c1

Browse files
authored
Update Magic Square.cpp
I have updated my code as you mentioned @christianbender. Kindly check it.
1 parent 414f197 commit ac449c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

math/Magic Square.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ bool isMagicSquare(int mat[][N])
4141

4242
int main()
4343
{
44-
int mat[3][N] ,i,j;
44+
int mat[3][N] ,i,k;
4545

4646
for(i=0; i<3; i++)
4747
{
48-
for(j=0; j<3; j++)
49-
cin>>mat[i][j];
48+
for(k=0; k<3; k++)
49+
cin>>mat[i][k];
5050
}
5151

5252
if (isMagicSquare(mat))

0 commit comments

Comments
 (0)