79251296

Date: 2024-12-04 13:17:28
Score: 1
Natty:
Report link

A few remarks after reading the first lines of main :

if (n < 0 && n > 9)

I guess you meant || : this statement in not possible

Your example input is not valid : size 4 means a grid of 4 by 4 = 16 inputs expected, you enter "transpose" way too soon...

   // ** process ***************************************************
        for (size_t i = 0; i < MAX; i++){
            for (size_t j = 0; j < MAX; j++) {
                cin >> grid[i][j];            // take in data to make grid
            }

Moreover because you ask for a size (user entered the "n" variable) but are using MAX in your loops...

This relates to my 1st comment : I'd suggest that you make your program say what input it expects so that you understand better what's going on, before using a debugger, that would be a further step to "how can I better fix my code", but I think not yet necessary.

Also, as @mikeb said, "read the open letter about homework: https://softwareengineering.meta.stackexchange.com/questions/6166/open-letter-to-students-with-homework-problems"

Good luck!

Reasons:
  • Blacklisted phrase (0.5): how can I
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @mikeb
  • Low reputation (0.5):
Posted by: Aname