30 by clamitze

VIEWS: 23 PAGES: 1

									#include<conio.h> #include<fstream.h> void main() {clrscr(); int sum=0,v[11][11],i,k,n,j; ifstream f("mat.in"); f>>n; for(i=1;i<=n;i++) for(j=1;j<=n;j++) f>>v[i][j]; for(k=n;k>=2;k--) for(i=n;i>=k;i--) sum+=v[i][n-i+k]; cout<<"suma elementelor este "<<sum<<endl; getch();}


								
To top