算法程序和编程.pptVIP

  • 3
  • 0
  • 约2.3千字
  • 约 73页
  • 2019-10-02 发布于广东
  • 举报
第四章 算法、程序与编程;问题的提出: 人是如何来解决问题的? 人是如何解决复杂问题的? 计算机如何来解决问题的? 问题的解决——计算机算法、程序与编程;第四章 算法、程序与编程;一种逐步解决问题或完成任务的方法;寻找最大值的一个算法(1);寻找最大值的一个算法(2);算法的例子示意图;算法的精化;算法的泛化;;;流程图;算法的表示;伪代码:是在编写算法时,为了更好地表示算法本身,不在一些小的细节上纠缠,而采用类似于英语(或其他自然语言)表示算法的算法表示方法。;伪代码;用伪代码写出一个求两个数的平均值的算法; Pass/NoPassGrade Input: One number if (the number is greater than or equal to 60) then 1.1 Set the grade to “pass” else 1.2 Set the grade to “nopass” End if Return the grade End; LetterGrade Input: One number 1. if (the number is between 90 and 100, inclusive) then 1.1 Set the grade to “A” End if 2. if (the number i

文档评论(0)

1亿VIP精品文档

相关文档