Documentos de Académico
Documentos de Profesional
Documentos de Cultura
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}
/*Programa Realizado por Diego Alejandro Lopez
Algortimo Extendido de Euclies*/
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}
/*Programa Realizado por Diego Alejandro Lopez
Algortimo Extendido de Euclies*/
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}
v/*Programa Realizado por Diego Alejandro Lopez
Algortimo Extendido de Euclies*/
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}
/*Programa Realizado por Diego Alejandro Lopez
Algortimo Extendido de Euclies*/
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}
/*Programa Realizado por Diego Alejandro Lopez
Algortimo Extendido de Euclies*/
#include<iostream>
using namespace std;
int main()
{
int a, b, aux;
int mcd;
cout<<"Ingrese primer numero: ";
cin>>a;
cout<<"Ingrese segundo numero: ";
cin>>b;
if (a<b)
{
aux=b;
b=a;
a=aux;
}
mcd=algoritmo(a,b);
//Implementacion de Funcion
if(n2==0)
{
opcion[0]=n1;
opcion[1]=1;
opcion[2]=0;
}
else
{
while(n2>0)
{
q = (n1/n2);
r = n1 - q*n2;
x = x2-q*x1;
y = y2 - q*y1;
n1 = n2;
n2 = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
opcion[0] = n1;
opcion[1] = x2;
opcion[2] = y2;
}
max_com=opcion[0];
return max_com;
}