摘 要: C语言是使用时间最久和最普及的计算机高级程序设计语言之一,属于面向过程的程序设计语言,兼有汇 编语言和高级语言的双重特点,是人们学习计算机程序设计的首选语言,也是学习其他计算机课程和进行软件开发的基 础。C语言程序设计中的循环语句是C语言的一个难点,可以用来解决许多具有规律性重复操作的实际问题,文章通过 对“百钱买百鸡”这个问题的算法进行设计、分析和优化,以寻求解决问题的最优算法。 |
关键词: C语言;循环语句;百钱买百鸡 |
中图分类号: TP311.1
文献标识码: A
|
|
An Analysis of the Algorithm for "Spending 100 Dollars on 100 Chickens" in C Programming Language |
LONG Minmin
|
( Hengyang Radio & TV University, Hengyang 421001, China)
|
Abstract: As a process-oriented programming language,C programming language is one of the most classic and popular computer programming languages with the characteristics of the assembly language and the high-level language.It is not only the first choice for the people who begin to learn computer programming,but also the basis for other computer courses and software development.As a difficult point in C Programming Language learning,the loop statement can be used to solve many practical problems of regularly repetitive operation.Taking the case of "spending 100 dollars on 100 chickens",the paper implements design,analysis and optimization,and finally proposes the optimal algorithm. |
Keywords: C programming language;loop statement;spending 100 dollars on 100 chickens |