martes, 1 de octubre de 2019

CÓDIGO 17.

#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.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 ();
    system("PAUSE");
    system("CLS");

    imprime();

    return 0;
}
    void captura ()
{
     for(f=0;f<=3;f++)
     for(c=0;c<=3;c++)
{

     cout<<"captura un numero"<<endl;
     cin>>mat[f][c];
  }

}

    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

Examen 4

#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; void menu(); void captura(); void i...