You are viewing a single comment's thread. Return to all comments →
no need to use extra for loop.
for(int a_i = 0;a_i < n;a_i++){ for(int a_j = 0;a_j < n;a_j++){ cin >> a[a_i][a_j]; } d1 = d1 + a[a_i][a_i]; d2 = d2 + a[a_i][n-1-a_i]; }
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
no need to use extra for loop.