viernes, 18 de octubre de 2019

CÓDIGO 18...

                                                               PROGRAMA 18
                                                                                          (matrices)


#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
int j,i,mat[4][4],x=5,y=8;
void captura();
void imprime();
void imprimerespuesta();
void gotoxy(int x,int y){
     HANDLE hcon;
     hcon=GetStdHandle(STD_OUTPUT_HANDLE);
     COORD dwPos;
     dwPos.X=x;
     dwPos.Y=y;
     SetConsoleCursorPosition(hcon,dwPos);
}
int main()
{
       captura();
       system("PAUSE");
       system("CLS");
       imprime();
       system("PAUSE");
       imprimerespuesta();
       system("PAUSE");


       return 0;
}

    void captura()
{
    for(int i=0; i<=3; i++){
        for(int j=0; j<=2; j++){
        gotoxy(x,y);
        cin>>mat[i][j];
        x+=5;
}
        y+=2;
        x=5;
}
    system("color 3");
}


      void imprime()
{

    for(int i=0; i<=3; i++){
        for(int j=0; j
        <=2; j++){
                gotoxy(x,y);
        cout<<mat[i][j];
        x+=5;
}
        y+=2;
        x=5;


}
     system("color 3");
    //system("cls");

}

     void imprimerespuesta()
{

    for(int i=0; i<=2; i++){
        for(int j=0; j<=3; j++){
        gotoxy(x,y);
        cout<<mat[j][i];
        x+=5;
}
        y+=2;
        x=5;


}
system("color 3");
}





No hay comentarios.:

Publicar un comentario