Well, if the user can enter anything, perhaps you should consider using a single char as the symbol instead of an int. That will allow 'A', 'b', '!', etc. Also, it will allow another trick for counting character occurrences.
First, you need an array of counts, so you can count occurrences of all symbols at once. The simple version (assuming values of 1 to n) would be something like:
Code:
unsigned char matrix[n][n];
int symbol_count[UCHAR_MAX + 1];
...
for i from 0 to n-1
initialize symbol_count to all 0's
for j from 0 to n-1
if matrix[i][j] is symbol 0
symbol_count[0]++
UCHAR_MAX is probably 255 since an unsigned char typically ranges from 0 to 255. You want to declare UCHAR_MAX+1 so you have 256 elements in the array, having indexes 0 to 255.
Now, there's a better way than a giant mess of if statements checking each symbol type. You can nest array-like statements
Code:
symbol_count[matrix[i][j]]++;
Basically, that looks up the symbol at matrix[i][j], uses it to index the symbol_count array, and increments that slot in the symbol_count array.