Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- /* Da se ispecatat elementite koj sto pripagjaat na glavnata dijagonala. */
- int main()
- {
- int m,n,i,j,sum,a[100][100];
- scanf("%d%d", &m, &n);
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- scanf("%d", &a[i][j]);
- }
- }
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- if(i == j)
- {
- printf("%d ", a[i][j]);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement