Matriz superior



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

// Matris superior


1   1   1   1   1
0   1   1   1   1
0   0   1   1   1
0   0   0   1   1
0   0   0   0   1


#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)
           {
               m[f][c]=1;
           }
           else
           {
               m[f][c]=0;
           }
        }
   }
   for(f=0;f<i;f++)
   {
       cout<<"n";         // aqui va una barra junto a la n
       cout<<"n";        //  coloquenla siempre q aparesca "n" o "t" dentro de las comillas

       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