add trick example of greatest-common-divisor, knuth-morris-pratt, primality-test, quick-pow, split-text

This commit is contained in:
2025-09-23 11:25:26 +08:00
parent 57dd0e9440
commit 5368fcd277
5 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
int greatest_common_divisor(int num1, int num2) {
while (num2 != 0) {
int temp = num2;
num2 = num1 % num2;
num1 = temp;
}
return num1;
}