113 人解决,133 人已尝试。
134 份提交通过,共有 351 份提交。
2.9 EMB 奖励。
单点时限: 3.0 sec
内存限制: 256 MB
Your task is to find a greatest common divisor(GCD) from given integers.
Input consists from multiple test cases.The first line of each test case contains single positive integer n (1 < n < 1024) which indicates the number of integers to find a GCD. Next line contains n positive integers separated by a single space. You have to calculate a GCD from these integers. A single line containing 0 denotes the end of input.
You can assume that input integers always fit in 32-bit signed integer.
For each test case, you should output a GCD for each line.
2 4 10 0
2
113 人解决,133 人已尝试。
134 份提交通过,共有 351 份提交。
2.9 EMB 奖励。