文件名称:Greatest-common-divisor-(GCD)
介绍说明--下载内容均来自于网络,请自行研究使用
用递归调用和辗转相除法求两个整数的最大公约数(输入多组数据,每个数在1到1000之间;输出为一行一个公约数)。-Calculate and output the greatest common divisor (GCD) of a pair of integers.The classic algorithm for computing the GCD, known as Euclid’s algorithm, goes as follows: Let m and n be variables containing the two numbers. If n is 0, then stop: m contains the GCD.Use recursion.(There will be multiple input sets. The line contains two integer between 1 and 1000. For each test case, output one line.)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Greatest common divisor (GCD).doc