Good. So if the number of the row (variable i) is equal to the number of the column (variable j) print a 5, otherwise print a @.

If I just hand out the code you won't learn anything, but the previous sentence is pretty much all you need. Just translate it into code form. The bolded parts are hints.