jueves, 14 de noviembre de 2019

Programa 17 (Parte 2)

Programa 17 (Parte 2)
#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

int mat[4][4],f,c,x=5,y=8;

void captura();
void imprime();
void gotoxy (int x, int y)
{
    HANDLE hcon;
    hcon=GetStdHandle(STD_OUTPUT_HANDLE);
    COORD dwPos;
    dwPos.X=x;
    dwPos.Y=y;
    SetConsoleCursorPosition(hcon,dwPos);
}
void captura();
void imprime();

int main()
{
 captura();
 
 imprime();
 
 return 0;
}

void captura()
{
 for(f=0; f<=3; f++)
        for(c=0; c<=3; c++)
    {
        cout <<"Captura un numero:  " ;
        cin >> mat[f][c];
    }
    system("cls");
   
}

void imprime(){
    for(int f=0; f<=3; f++){
        for(int c=0; c<=3; c++){
        gotoxy(x,y);
        cout << mat[f][c];
        x+=5;
    }
        y+=2;
        x=5;
    }
    system("color 4");
    //system("Cls");

}

No hay comentarios.:

Publicar un comentario