Matriz inferior


BY
JOSE MIGUEL BRICEÑO
WWW.M3TALIJOX.ES.TL

// Matris inferior
1   0   0   0   0
1   1   0   0   0
1   1   1   0   0
1   1   1   1   0
1   1   1   1   0


#include<iostream.h>

#include<math.h>

void main()
{


   float m[100][100];
   int i=0,j=0;

   cout<<"nt Ingreza la cantidad de columnas: "<<"t";
   cin>>j;
   cout<<"nt Ingreza la cantidad de filas: "<<"t";
   cin>>i;
   
   for(int f=0;f<i;f++)
   {
       for(int c=0;c<j;c++)
       {
           if(f>=c)         //Condicion
           {
               m[f][c]=1;
           }
           else
           {
               m[f][c]=0;
           }
        }
   }
   for(f=0;f<i;f++)
   {
       cout<<"n";
       cout<<"n";
       cout<<"ttt";
       for(int c=0;c<i;c++)
       {
           cout<<"    ";
           cout<<m[f][c];
       }
   }
   cin.get();
   cin.get();
}
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis