Professional Documents
Culture Documents
Cristian Fabian Infante Canelo 1660004518
Cristian Fabian Infante Canelo 1660004518
Cristian Fabian Infante Canelo 1660004518
1660004518
# include "conio.h"
# include "iostream.h"
# include "stdio.h"
# include "windows.h"
int M1[10][10],M2[10][10],Tam,aux[50],aux2,a,iguales,cont;
void PEDIR(){
gotoxy(6,4);printf("MATRIZ 1");
for(int i=0;i<Tam;i++){
for(int j=0;j<Tam;j++){
gotoxy(j*5+6,i*2+6);
scanf("%d",&M1[i][j]);
while (M1[i][j]==0)
gotoxy(j*5+6,i*2+6);
clreol();
scanf("%d",&M1[i][j]);
main()
Cristian Fabian Infante Canelo
1660004518
char opc='s';
do
clrscr();
PEDIR();
iguales=0;
for(int g=0;g<(Tam);g++){
for(int h=0;h<(Tam);h++){
M2[g][h] = M1[g][h];
for(int g=0;g<(Tam);g++){
for(int h=0;h<(Tam);h++){
for(int i=0;i<(Tam);i++){
for(int j=0;j<(Tam);j++){
if((g != i) || (h != j)){
if(M1[g][h] == M2[i][j]){
M2[i][j] = 0;
M2[g][h] = 0;
aux[iguales] = M1[g][h];
iguales++;
}
Cristian Fabian Infante Canelo
1660004518
printf("%d ",aux[i]);
getch();
for(int g=0;g<(Tam);g++){
for(int h=0;h<(Tam);h++){
for(int i=0;i<(Tam);i++){
for(int j=0;j<(Tam);j++){
aux2=M1[g][h];
M1[g][h]=M1[i][j];
M1[i][j]=aux2;
for(int g=0;g<(Tam);g++){
for(int h=0;h<(Tam);h++){
for(int i=0;i<(Tam);i++){
Cristian Fabian Infante Canelo
1660004518
for(int j=0;j<(Tam);j++){
if(M1[g][h]%2!=0){
aux2=M1[g][h];
M1[g][h]=M1[i][j];
M1[i][j]=aux2;
for(int g=0;g<(Tam);g++){
for(int h=0;h<(Tam);h++){
for(int i=0;i<(Tam);i++){
for(int j=0;j<(Tam);j++){
if((M1[g][h]%2==0)&&(M1[i][j]%2==0)){
aux2=M1[g][h];
M1[g][h]=M1[i][j];
M1[i][j]=aux2;
for(int i=0;i<Tam;i++){
for(int j=0;j<Tam;j++){
gotoxy(j*5+6,i*2+16);
printf("%d",M1[i][j]);
a=16;
cont=0;
cont+=M1[i][j];
gotoxy(25,a);
a+=2;
getch();
clrscr();
while((opc=='s')||(opc=='S'));
clrscr();
getch();