Già ti è stato detto che per la diagonale principale basta un solo for ... perché ripeti l'errore?