Skip to content

Instantly share code, notes, and snippets.

@QuantumHawk
Created February 25, 2015 07:13
Show Gist options
  • Save QuantumHawk/091332db9de8ee617b60 to your computer and use it in GitHub Desktop.
Save QuantumHawk/091332db9de8ee617b60 to your computer and use it in GitHub Desktop.
public class Evklid {
int x1;
int y1;
int Evklid (int a, int b, int x, int y) {
if (a == 0) {
x = 0; y = 1;
return b;
}
int d = Evklid (b%a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;
}}
@kayuri
Copy link

kayuri commented Feb 25, 2015

public class Evklid {
int x1;
int y1;
int x;
int y;

int Evklid (int a, int b) {

if (a == 0) {
    x = 0; y = 1;
    return b;
}

int d = Evklid (b%a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;

}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment