c语言论文
用迭代法求两个数的最大公约数和最小公倍数
化工09110605
摘要:迭代法是一种循环控制语句和循环结构程序的设计方法。在计算机解决问
题的时候,总希望从复杂的问题中找到规律,并归结为简单问题的重复,发挥其
擅长重复运算的特点,让它重复执行一组语句,直到满足给定条件为止。因此,
c语言提供了重复操作的语句,由这些语句构成的程序称为循环结构。本文就
是采用迭代法,利用c语言中提供的重复语句,求得两个数的最大公约数和最小
公倍数。
关键词:循环语句;循环结构;迭代法;最大公约数和最小公倍数
Iterative Method with the greatest common divisor and least
common multiple of two numbers
Chemical 09110605 WANG Meng
Abstract: The iterative method is a loop control statement and loop structure
design process. When the computer to solve the problem, hoping to find from the
law of complex issues and boil down to a simple repetition of questions, to play the
good characteristics of repeat operation, let it repeat a set of statements until the date that satisfies the given conditions. Therefore, c language repeat the statement
provided by these statements constitute the program is called loop structure. This
is the iterative method, using c language provided by the repeated statement,
obtained the greatest common divisor and least common multiple of two
numbers.
Key words: loop; loop structure; iteration; greatest common divisor and least common multiple