basically everything is backwards, I have all the right numbers.
Here is the instructions:
Magic Squares. An n x n matrix that is filled with the numbers 1,2,3,…,n2 is a magic square if the sum of the elements in each row, in each column, and in the two diagonals is the same value.
The following algorithm will construct magic n x n squares; it only works if n is odd: Place 1 in the middle of the bottom row. After k has been placed in the (i,j) square, place k+1 into the square right and down, wrapping around the borders. However, if you reach a square that has already been filled, then you must move one square up instead.
Here is my code so far:
//Magic numbers program
//7-24-15
#include <iostream>
#include <iomanip>
using namespace std;
As far as I can tell it does not matter, right?
I mean, both of them are magic squares...
However, I can only give you 1 solution:
1) flip the matrix upside down and left to right (you'd have to do that yourself)
you on the other hand can do other things:
2) you have to take a closer look at your algorithm.
I don't know this algorithm works so I would have a hard time helping you, I'm sorry.
It's probably something to do with the indices of matrix.
3) you could cheat with the output, just print the values backwards :')