Programa 16 (Parte 2)
#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int mat[6][6],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<=5; f++)
for(c=0; c<=5; c++)
{
cout <<"Captura un numero: " <<endl;
cin >> mat[f][c];
}
system("cls");
}
void imprime(){
for(int f=0; f<=5; f++){
for(int c=0; c<=5; c++){
gotoxy(x,y);
cout << mat[f][c];
x+=5;
}
y+=2;
x=5;
}
system("color 4");
//system("Cls");
}
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int mat[6][6],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<=5; f++)
for(c=0; c<=5; c++)
{
cout <<"Captura un numero: " <<endl;
cin >> mat[f][c];
}
system("cls");
}
void imprime(){
for(int f=0; f<=5; f++){
for(int c=0; c<=5; 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