1#include <iostream>
2
3using namespace std;
4
5int hcf(int a, int b) {
6 while (a != b) {
7 if (a > b)
8 a = a - b;
9 else
10 b = b - a;
11 }
12 return a;
13}
14
15int main() {
16 int a = 24, b = 36;
17 cout << hcf(a, b) << endl;
18 return 0;
19}