pa-03
This commit is contained in:
6
pa-03/a2/ggt.c
Normal file
6
pa-03/a2/ggt.c
Normal file
@@ -0,0 +1,6 @@
|
||||
int ggt(int a, int b) {
|
||||
// https://de.wikipedia.org/wiki/Gr%C3%B6%C3%9Fter_gemeinsamer_Teiler#Rechenregeln_f%C3%BCr_Zahlen
|
||||
if (a == 0) return b;
|
||||
if (b == 0) return a;
|
||||
return ggt(b, a % b);
|
||||
}
|
||||
Reference in New Issue
Block a user