Text: |
ԲΠ= ÁÑÑ
Çàïèòàííÿ:ÒÎ ×ÒÎ ÅÑÒÜ:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
setlocale(LC_ALL,"RUS");
int n,m;
cout<<"Ââåäèòå êîëè÷åñòâî ñòðîê: ";
cin>>n;
cout<<"Ââåäèòå êîëè÷åñòâî ñòîëáöîâ: ";
cin>>m;
int a[n][m];
for(int x=0;x<n;x++)
{for(int y=0;y<m;y++)
{
cout<<"Ââåäèòå "<<x+1<<" ýëåìåíò "<<y+1<<" ñòîëáöà: ";
cin>> a[x][y];
}
}
cout<<"A=";
for(int x=0;x<n;x++)
{for(int y=0;y<m;y++)
{ if(y==(m-1)) cout<<"\t"<<a[x][y]<<endl;
else cout<<"\t"<<a[x][y];
}
}
cout<<"\nAT=";
for(int x=0;x<n;x++)
{for(int y=0;y<m;y++)
{ if(y==(m-1)) cout<<"\t"<<a[y][x]<<endl;
else cout<<"\t"<<a[y][x];
}
}
cout<<"\nA*AT=";
for(int x=0;x<n;x++)
{for(int y=0;y<m;y++)
{ if(y==(m-1)) cout<<"\t"<<a[x][y]<<endl;
else cout<<"\t"<<a[x][y]*a[x][y];
}
}
system("PAUSE");
return EXIT_SUCCESS
====================================
|