Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #define N 15
- using namespace std;
- int main(){
- int nfil, ncol ;
- int i=0, j=0;
- cout<< "Ingresa el nro de filas de la matriz" << endl;
- cin>> nfil; // Supongamos que ingrese 10
- cout<< "Ingresa el nro de columnas de la matriz" << endl;
- cin>> ncol; // Supongamos que ingrese 10
- int matriz[N][N]; // mi matrix es de tamano 10x10
- cout<< "Ingrese los " <<nfil*ncol<<" numeros de la matriz de NxM: \n" ;
- for(i=0; i<nfil; i++){
- for (j=0 ; j< ncol ;j++){
- cin>> matriz[i][j]; //almaceno la matriz
- }
- }
- cout<<"\nMatriz transpuesta\n" ;/*IMPRIMIR MATRIZ TRANSPUESTA*/
- for(i=0; i<ncol; i++){
- for(j=0; j<nfil; j++){
- cout<<" "<<matriz[j][i] ;
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement