12905 - GCD of Two Numbers   

Description

Given two natural numbers. Please write a C program to find out what is the greatest common divisor of these two natural numbers.

Hint: Use “Euclidean algorithms” (輾轉相除法).

Input

Two integers Num1, Num2.

Note that:

  1. 1 <= Num1, Num2 <= 32,767.

Output

Output should follow below format:

N

Note that:

  1. Need to have a return value('\n') at the end of your string.

Sample Input  Download

Sample Output  Download

Tags




Discuss