//Transpose
#include <stdio.h>
#define MAX 20
int m,n;
void transpose(double a[][MAX],double b[][MAX])
{
int i,j;
for(i=0;i<MAX;i++)
for(j=0;j<MAX;j++)
b[i][j]=a[j][i];
}
void main()
{
int i,j;
double a[MAX][MAX],b[MAX][MAX];
puts("Please input the dimensions of the matrixe:");
puts("(in term of ¡°2 3¡±).");
scanf("%d %d",&m,&n);
puts("Enter the matrix:");
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%lf",&a[i][j]);
transpose(a,b);
puts("The Transpose as follow:");
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载