Here is my implementation of the Euclidean Algorithm. My question is how to make it more "professional". It's working right, but isn't this too newbie?
public class Euklideszi {
public int Euklideszi(int a, int b, boolean lepesrolLepesre) {
int r = a % b;
if (a < b) {
r = a;
a = b;
b = r;
}
if (a % b == 0) {
if (lepesrolLepesre) {
System.out.println("A legnagyobb közös osztó: " + b);
}
return b;
} else {
while (r != 0) {
r = a % b;
if (lepesrolLepesre) {
System.out.println(a + "=" + a / b + "*" + b + "+" + r);
}
a = b;
b = r;
}
if (lepesrolLepesre) {
System.out.println("A legnagyobb közös osztó: " + a);
}
return a;
}
}
}