added ws202425 courses

This commit is contained in:
2024-11-14 13:11:04 +01:00
parent 800282c2e8
commit beb31897b1
461 changed files with 20368 additions and 0 deletions
@@ -0,0 +1,32 @@
public class Gcd{
public static int gcd(int num, int denom){
int x = num;
int y = denom;
// Sonderfall abfangen
if (x == 0)
return y;
if (y == 0)
return x;
// Endlosschleife vermeiden
if (x < 0)
x = -x;
if (y < 0)
y = -y;
// Algorithmus von Euklid
while (x != y) {
if (x > y)
x = x - y;
else
y = y - x;
}
return x;
}
}