#include <iostream>
using namespace std;
int x[30][30],n,m,i,j,s=0;
void citire(int x[10][10],int y)
{
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{cout<<"x["<<i<<"]["<<j<<"]=";
cin>>x[i][j];
}
}
void afisare()
{
for( i=1;i<=n;i++)
{
for( j=1;j<=n;j++)
cout<<x[i][j]<<" ";
cout<<"\n";
}
}
void suma(int x[10][10],int y)
{
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
if(i+j=n+1)
s=s+x[i][j];
cout<<"suma elementelor din matrice="<<s<<endl;
}
int main()
{ int a[10][10],b[10][10],c[10][10],d[10][10],e[10][10];
cout<<"se citeste matricea: "<<endl;
citire(a,3);
citire(b,3);
citire(c,3);
citire(d,3);
citire(e,3);
cout<<"matricea este\n";
afisare();
return 0;
}
Niciun comentariu:
Trimiteți un comentariu