#K93032. Compute the Greatest Common Divisor (GCD)
Compute the Greatest Common Divisor (GCD)
Compute the Greatest Common Divisor (GCD)
Given a series of pairs of integers, your task is to compute the greatest common divisor (GCD) for each pair. The GCD of two integers \(a\) and \(b\), denoted \(\gcd(a, b)\), is the largest integer that divides both without leaving a remainder.
The input consists of multiple lines, each containing two integers separated by a space. The program should process each pair and output the GCD on a new line. The input will end when a pair of zeroes (i.e. "0 0") is encountered, and this terminating line should not produce any output.
Example:
Input: 48 18 99 78 101 103 0 0</p>Output: 6 3 1
inputFormat
The input is provided via standard input (stdin) and includes multiple lines. Each line contains two integers \(a\) and \(b\) separated by a space.
The program should terminate processing when encountering a line with the pair "0 0".
outputFormat
For every valid input pair (except for the terminating "0 0"), output the greatest common divisor on a new line using standard output (stdout). The output should not include any extra characters or formatting.
## sample48 18
0 0
6
</p>