Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by has ( 14 years ago )
#include <stdio.h>
#include <stdlib.h>
int main()
{
int z=0, s=0, n=3;
double *matrix;
printf("Groesse der quadratischen Matrix: ");
scanf("%i", &n);
/* Speicher reservieren */
matrix = (double *) malloc(n*n * sizeof(double));
/* Matrixelemente einlesen */
for (z=0; z<n; ++z){
for (s=0; s<n; ++s){
printf("Element %i/%i: ", z, s);
scanf("%lf", &matrix;[ z*n + s ]);
}
}
/* Ausgeben der Transponierten */
printf("Die Transponierte lautet:\n");
/* Beim Transponieren werden Zeilen und Spalten vertauscht: */
for (s=0; s<n; ++s){
for (z=0; z<n; ++z){
printf("%8.2lf", matrix[ z*n + s ]);
}
printf("\n");
}
return 0;
}
Revise this Paste