jueves, 14 de noviembre de 2019

Programa 18 (Parte 2)

Programa 18 (Parte 2)

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

using namespace std;
int n,m,A[3][4],x=5,y=0;

void captura();
void imprime();
void imprimetraspuesta();

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();
 imprime();
 imprimetraspuesta();

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

void imprime(){
  for(int i=0; i<=2; i++){
        for(int j=0; j<=3; j++){
        gotoxy(y,x);
        cout<< A[i][j];
        x+=5;
    }
        y+=2;
        x=5;
    }
     system("color 3");
    system("pause");
    system("cls");
    //system("Cls");

}

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

    system("pause");
    system("cls");

   }

No hay comentarios.:

Publicar un comentario