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