Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Matrice ++
SUBMITTED BY:
Guest
DATE:
Dec. 20, 2014, 8:14 p.m.
FORMAT:
Text only
SIZE:
776 Bytes
Raw
Download
Tweet
HITS:
7935
Go to comments
Report
#include <iostream>
using namespace std;
int main()
{
int x[10][10], i, j,s=0,m,n;
cout<<"nr de linii "; cin>>n;
cout<<"nr de col "; cin>>m;
cout<<"Introduceti elementele matricei: "<<endl;
for (i=1; i<=n; i++)
for (j=1; j<=m; j++)
{
cin>>x[i][j];
}
cout<<"Afisam matricea: "<<endl;
for (i=1; i<=n; i++)
{ for (j=1; j<=m; j++)
{cout<<x[i][j]<<" ";}
cout<<endl;}
cout<<"interschimbare elemente: "<<endl;
for (i=1;i<=m;i++){
for (j=1;j<=n;j++)
{
cout<<x[j][i]<<" ";
}
cout<<endl;}
for (i=1; i<=n; i++)
for(j=1;j<=m; j++)
s=s+x[i][j];
cout<<"suma este "<<s;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus