English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

Use Euler's Algorithm for finding the GCD. It's an amazingly simple algorithm and trivial to implement.

A = 48;
B = 36;

while( B != 0) {
temp = A % B;
A = B;
B = temp;
}

print A;

2007-01-08 00:04:28 · answer #1 · answered by Kookiemon 6 · 0 0

It's the "do my homework challenge"!

2007-01-08 05:20:11 · answer #2 · answered by Anonymous · 0 1

fedest.com, questions and answers