单点时限: 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
| 题目 | 计分 |
|---|---|
| A | 100 |
| B | 100 |
| C | 100 |
| D | 100 |
| E | 100 |
| F | 100 |
| G | 100 |
| H | 100 |
| I | 100 |
| J | 100 |
| K | 100 |
| L | 100 |
| M | 100 |
| N | 100 |
| O | 100 |
| P | 100 |
| Q | 100 |
| R | 100 |