论文部分内容阅读
算法(algorithm)通常是指可以用计算机来解决的某一类问题的程序或步骤,这些程序或步骤必须明确、有效,而且能够在有限步之内完成.例1 设计一个算法,输入年份 y,判断该年份是否为闰年并输出结果,画出程序框图.算法分析由于地球绕太阳运行周期为365天5小时48分46秒(合365.24219天)即一回归年,公历把一年定为365天,所余下的时间约四年累计一天,加在二月里,所以平常年份每年365天,二月为28天,闰年为366天,二月为29
Algorithm (algorithm) usually refers to a program or step that can solve a certain type of problem with a computer. These procedures or steps must be clear and effective, and can be completed within a limited step. Example 1 Design an algorithm and enter the year y. Determine if the year is a leap year and output the result. Draw a block diagram. Algorithm analysis Since the earth’s orbit around the sun is 365 days 5 hours 48 minutes 46 seconds (365.24219 days), a return year, the Gregorian calendar sets the year as 365 days. The remaining time is about four years cumulatively, plus in February, so the usual year is 365 days per year, February is 28 days, leap year is 366 days, and February is 29