当前位置:首页 » 编程软件 » 编程经典

编程经典

发布时间: 2022-06-29 03:25:32

1. 编程书籍经典的有哪些

算法/数据结构/底层理论:
《算法导论》:学习算法的必读书,也应作为程序员 ”基本素养“ 看一看
《计算机程序设计艺术》:一部仍未完成的着作,作者高德纳因此获得美国计算机协会 1974 年图灵奖 - wikipedia:计算机程序设计艺术
《数据结构与算法分析》
《具体数学》
编译原理》:编译理论的 ”龙书“
《深入理解计算机系统》
编程语言/工具等:
《C 程序设计语言》:C 语言发明者之一 Dennis 的经典 C 语言教程
《C++ Primer》
java 编程思想》
《OpenGL 编程指南》:”红宝书“
php 和 Mysql Web 开发》:不要看目前的中文版
软件工程/开发
《设计模式》
《人月神话》:被誉为软件工程领域的圣经 - wikipedia:人月神话
《重构》
《代码大全》
《程序员修炼之道》:如何 ”编程“?

2. java编程经典书籍有哪些

以下详细介绍了如何学习Java,如果楼主有耐心的话,建议仔细看一下~

学习一门新的知识,不可能指望只看一本,或者两本书就能够完全掌握。需要有一个循序渐进的阅读过程。我推荐Oreilly出版的Java系列书籍。

在这里我只想补充一点看法,很多人学习Java是从《Thinking in Java》这本书入手的,但是我认为这本书是不适合初学者的。我认为正确的使用这本书的方法应该是作为辅助的读物。《Thinking in Java》并不是在完整的介绍Java的整个体系,而是一种跳跃式的写作方法,是一种类似tips的方法来对Java很多知识点进行了深入的分析和解释。

对于初学者来说,最好是找一本Java入门的书籍,但是比较完整的循序的介绍Java的语法,面向对象的特性,核心类库等等,在看这本书的同时,可以同步来看《Thinking in Java》,来加深对Java的理解和原理的运用,同时又可以完整的了解Java的整个体系。

对于Java的入门书籍,蔡学镛推荐的是Oreilly的《Exploring Java, 2nd Edition》 或者《Java in a Nutshell,2nd Edition(针对C++背景)》,我并没有看过这两本书。其实我觉得电子工业出版社的《Java 2编程详解》或者《Java 2从入门到精通》就很不错。

在所有的Java书籍当中,其实最最有用的,并不是O'reilly的 Java Serials,真正最最有用处是JDK的Documentation!几乎你想获得的所有的知识在Documentation里面全部都有,其中最主要的部分当然是Java基础类库的API文档,是按照package来组织的,对于每一个class都有详细的解释,它的继承关系,是否实现了某个接口,通常用在哪些场合,还可以查到它所有的public的属性和方法,每个属性的解释,意义,每个方法的用途,调用的参数,参数的意义,返回值的类型,以及方法可能抛出的异常等等。可以这样来说,所有关于Java编程方面的书籍其实都不过是在用比较通俗易懂的语言,和良好的组织方式来介绍Documentation里面的某个package里面包含的一些类的用法而已。所以万变不离其宗,如果你有足够的能力来直接通过Documentation来学习Java的类库,那么基本上就不需要看其他的书籍了。除此之外,Documentation也是编程必备的手册,我的桌面上有三个Documentation的快捷方式,分别是J2SDK1.4.1的Documentation,Servlet2.3的Documentation和J2SDKEE1.3.1的Documentation。有了这个三个Documentation,什么其他的书籍都不需要了。

对于Java Web 编程来说,最核心的是要熟悉和掌握HTTP协议,这个就和Java无关了,在熟悉HTTP协议之后,就需要熟悉Java的实现HTTP协议的类库,也就是Servlet API,所以最重要的东西就是Servlet API。当然对于初学者而言,直接通过Servlet API来学习Web编程有很大的难度,我推荐O'reilly的《Java Server Pages 》这本书来学习Web 编程。

EJB的书籍当中,《Enterprise JavaBeans, 2nd Edition》是一本很不错的书, EJB的学习门槛是比较高,入门很难,但是这本书完全降低了学习的难度,特别重要的一点是,EJB的学习需要结合一种App Server的具体实现,所以在学习EJB的同时,必须同步的学习某种App Server,而这本书相关的出了三本书,分别是Weblogic6.1,Websphere4.0和JBoss3.0上面部署书中例子的实做。真是既有理论,又有实践。在学习EJB的同时,可以边看边做,EJB的学习会变得很轻松。

但是这本书也有一个问题,就是版本比较旧,主要讲EJB1.1规范和部分EJB2.0的规范。而Ed Roman写的《Mastering EJB 2.0》这本书完全是根据EJB2.0规范写的,深入浅出,覆盖了EJB编程的各个方面,并且还有很多编程经验tips,也是学习EJB非常推荐的书籍之一。

如果是结合Weblogic来学习J2EE的话,《J2EE应用与BEA Weblogic Server》绝对是首选读物,虽然是讲述的Weblogic6.0,仍然值得购买,这本书是BEA官方推荐的教材,作者也是BEA公司的工程师。现在中文版已经随处可见了。这本书结合Weblogic介绍了J2EE各个方面的技术在Weblogic平台上的开发和部署,实践指导意义非常强。

在掌握了Java平台基础知识和J2EE方面的知识以后,更进一步的是学习如何运用OO的方法进行软件的设计,那么就一定要学习“设计模式”。Sun公司出版了一本《J2EE核心模式》,是每个开发Java企业平台软件的架构师必备的书籍。这本书全面的介绍了J2EE体系架构的各种设计模式,是设计师的必读书籍。

Java Learning Path(三)过程篇

每个人的学习方法是不同的,一个人的方法不见得适合另一个人,我只能是谈自己的学习方法。因为我学习Java是完全自学的,从来没有问过别人,所以学习的过程基本上完全是自己摸索出来的。我也不知道这种方法是否是比较好的方法,只能给大家提供一点参考了。

学习Java的第一步是安装好JDK,写一个Hello World, 其实JDK的学习没有那么简单,关于JDK有两个问题是很容易一直困扰Java程序员的地方:一个是CLASSPATH的问题,其实从原理上来说,是要搞清楚JRE的ClassLoader是如何加载Class的;另一个问题是package和import问题,如何来寻找类的路径问题。把这两个问题摸索清楚了,就扫除了学习Java和使用JDK的最大障碍。推荐看一下王森的《Java深度历险》,对这两个问题进行了深入的探讨。

第二步是学习Java的语法。Java的语法是类C++的,基本上主流的编程语言不是类C,就是类C++的,没有什么新东西,所以语法的学习,大概就是半天的时间足够了。唯一需要注意的是有几个不容易搞清楚的关键字的用法,public,protected,private,static,什么时候用,为什么要用,怎么用,这可能需要有人来指点一下,我当初是完全自己琢磨出来的,花了很久的时间。不过后来我看到《Thinking in Java》这本书上面是讲了这些概念的。

第三步是学习Java的面向对象的编程语言的特性的地方。比如继承,构造器,抽象类,接口,方法的多态,重载,覆盖,Java的异常处理机制。对于一个没有面向对象语言背景的人来说,我觉得这个过程需要花很长很长时间,因为学习Java之前没有C++的经验,只有C的经验,我是大概花了一个月左右吧,才彻底把这些概念都搞清楚,把书上面的例子反复的揣摩,修改,尝试,把那几章内容反复的看过来,看过去,看了不下5遍,才彻底领悟了。不过我想如果有C++经验的话,应该一两天时间足够了。那么在这个过程中,可以多看看《Thinking in Java》这本书,对面向对象的讲解非常透彻。可惜的是我学习的时候,并没有看到这本书,所以自己花了大量的时间,通过自己的尝试和揣摩来学会的。

第四步就是开始熟悉Java的类库。Java的基础类库其实就是JDK安装目录下面jre\lib\rt.jar这个包。学习基础类库就是学习rt.jar。基础类库里面的类非常非常多。据说有3000多个,我没有统计过。但是真正对于我们来说最核心的只有4个,分别是
java.lang.*;
java.io.*;
java.util.*;
java.sql.*;

这四个包的学习,每个包的学习都可以写成一本厚厚的教材,而O'reilly也确实是这样做的。我觉得如果时间比较紧,是不可能通过读四本书来学习。我觉得比较好的学习方法是这样的:
首先要通读整个package的框架,了解整个package的class,interface,exception的构成,最好是能够找到介绍整个包框架的文章。这些专门介绍包的书籍的前几章应该就是这些总体的框架内容介绍。

对包整体框架的把握并不是要熟悉每个类的用法,记住它有哪些属性,方法。想记也记不住的。而是要知道包有哪些方面的类构成的,这些类的用途是什么,最核心的几个类分别是完成什么功能的。我在给人培训的时候一般是一次课讲一个包,所以不可能详细的介绍每个类的用法,但是我反复强调,我给你们讲这些包的不是要告诉你们类的方法是怎么调用的,也不要求你们记住类的方法调用,而是要你们了解,Java给我们提供了哪些类,每个类是用在什么场合,当我遇到问题的时候,我知道哪个类,或者哪几个类的组合可以解决我的问题,That'all!,当我们具体写程序的时候,只要你知道该用哪个类来完成你的工作就足够了。编码的时候,具体的方法调用,是边写代码,边查Documentation,所有的东西都在Documentation里面,不要求你一定记住,实际你也记不住3000多个类的总共将近10万个方法调用。所以对每个包的总体框架的把握就变得极为重要。

第五步,通过上面的学习,如果学的比较扎实的话,就打好了Java的基础了,剩下要做的工作是扫清Documentation里面除了上面4个包之外的其他一些比较有用处的类。相信进展到这一步,Java的自学能力已经被培养出来了,可以到了直接学习Documentation的水平了。除了要做GUI编程之外,JDK里面其他会有用处的包是这些:
java.text.*;
java.net.*;
javax.naming.*;
这些包里面真正用的比较多的类其实很少,只有几个,所以不需要花很多时间。

第六步,Java Web 编程
Web编程的核心是HTTP协议,HTTP协议和Java无关,如果不熟悉HTTP协议的话,虽然也可以学好Servlet/JSP编程,但是达不到举一反三,一通百通的境界。所以HTTP协议的学习是必备的。如果熟悉了HTTP协议的话,又有了Java编程的良好的基础,学习Servlet/JSP简直易如反掌,我学习Servlet/JSP就用了不到一周的时间,然后就开始用JSP来做项目了。

在Servlet/JSP的学习中,重头仍然是Servlet Documentation。Servlet API最常用的类很少,花比较少的时间就可以掌握了。把这些类都看一遍,多写几个例子试试。Servlet/JSP编程本质就是在反复调用这些类来通过HTTP协议在Web Server和Brower之间交谈。另外对JSP,还需要熟悉几个常用JSP的标记,具体的写法记不住的话,临时查就是了。

此外Java Web编程学习的重点要放在Web Application的设计模式上,如何进行业务逻辑的分析,并且进行合理的设计,按照MVC设计模式的要求,运用Servlet和JSP分别完成不同的逻辑层,掌握如何在Servlet和JSP之间进行流程的控制和数据的共享,以及Web Application应该如何配置和部署。

第七步,J2EE编程
以上的学习过程如果是比较顺利的话,进行到这一步,难度又陡然提高。因为上面的知识内容都是只涉及一个方面,而像EJB,JMS,JTA等核心的J2EE规范往往是几种Java技术的综合运用的结晶,所以掌握起来难度比较大。

首先一定要学习好JNDI,JNDI是App Server定位服务器资源(EJB组件,Datasouce,JMS)查找方法,如果对JNDI不熟悉的话,EJB,JMS这些东西几乎学不下去。JNDI其实就是javax.naming.*这个包,运用起来很简单。难点在于服务器资源文件的配置。对于服务器资源文件的配置,就需要看看专门的文档规范了,比如web.xml的写法,ejb-jar.xml的写法等等。针对每种不同的App Server,还有自己的服务资源配置文件,也是需要熟悉的。

然后可以学习JTA,主要是要理解JTA对于事务的控制的方法,以及该在什么场合使用JTA。这里可以简单的举个例子,我们知道一般情况可以对于一个数据库连接进行事务控制(conn.setAutoCommit(false),....,conn.commit()),做为一个原子操作,但是假设我的业务需求是要把对两个不同数据库的操作做为一个原子操作,你能做的到吗?这时候只能用JTA了。假设操作过程是先往A数据库插一条记录,然后删除B数据库另一个记录,我们自己写代码是控制不了把整个操作做为一个原子操作的。用JTA的话,由App Server来完成控制。

在学习EJB之前要学习对象序列化和RMI,RMI是EJB的基础。接着学习JMS和EJB,对于EJB来说,最关键是要理解EJB是如何通过RMI来实现对远端对象的调用的,以及在什么情况下要用到EJB。

在学习完EJB,JMS这些东西之后,你可能会意识到要急不可待学习两个领域的知识,一个是UML,另一个是Design Pattern。Java企业软件的设计非常重视框架(Framework)的设计,一个好的软件框架是软件开发成功的必要条件。在这个时候,应该开始把学习的重点放在设计模式和框架的学习上,通过学习和实际的编程经验来掌握EJB的设计模式和J2EE的核心模式。

J2EE规范里面,除了EJB,JMS,JTA,Servlet/JSP,JDBC之外还有很多很多的企业技术,这里不一一进行介绍了。

另外还有一个最新领域Web Services。Web Services也完全没有任何新东西,它像是一种黏合剂,可以把不同的服务统一起来提供一个统一的调用接口,作为使用者来说,我只要获得服务提供者给我的WSDL(对服务的描述),就够了,我完全不知道服务器提供者提供的服务究竟是EJB组件,还是.Net组件,还是什么CORBA组件,还是其他的什么实现,我也不需要知道。Web Services最伟大的地方就在于通过统一的服务提供方式和调用方式,实现了整个Internet服务的共享,是一个非常令人激动的技术领域。Web Services好像目前还没有什么很好的书籍,但是可以通过在网络上面查资料的方式来学习。

Java Learning Path(四) 方法篇

Java作为一门编程语言,最好的学习方法就是写代码。当你学习一个类以后,你就可以自己写个简单的例子程序来运行一下,看看有什么结果,然后再多调用几个类的方法,看看运行结果,这样非常直观的把类给学会了,而且记忆非常深刻。然后不应该满足把代码调通,你应该想想看如果我不这样写,换个方式,再试试行不行。记得哪个高人说过学习编程就是个破坏的过程,把书上的例子,自己学习Documentation编写的例子在运行通过以后,不断的尝试着用不同的方法实现,不断的尝试破坏代码的结构,看看它会有什么结果。通过这样的方式,你会很彻底的很精通的掌握Java。

举个例子,我们都编过Hello World

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

很多初学者不是很理解为什么main方法一定要这样来定义public static void main(String[] args),能不能不这样写?包括我刚学习Java的时候也有这样的疑问。想知道答案吗?很简单,你把main改个名字运行一下,看看报什么错误,然后根据出错信息进行分析;把main的public取掉,在试试看,报什么错误;static去掉还能不能运行;不知道main方法是否一定要传一个String[]数组的,把String[]改掉,改成int[],或者String试试看;不知道是否必须写args参数名称的,也可以把args改成别的名字,看看运行结果如何。

我当初学习Java的时候就是这样做的,把Hello World程序反复改了七八次,不断运行,分析运行结果,最后就彻底明白为什么了main方法是这样定义的了。

此外,我对于staic,public,private,Exception,try{ }catch {}finally{}等等等等一开始都不是很懂,都是把参考书上面的例子运行成功,然后就开始破坏它,不断的根据自己心里面的疑问来重新改写程序,看看能不能运行,运行出来是个什么样子,是否可以得到预期的结果。这样虽然比较费时间,不过一个例子程序这样反复破坏几次之后。我就对这个相关的知识彻底学通了。有时候甚至故意写一些错误的代码来运行,看看能否得到预期的运行错误。这样对于编程的掌握是及其深刻的。

其中特别值得一提的是JDK有一个非常棒的调试功能,-verbose
java –verbose
javac –verbose 以及其它很多JDK工具都有这个选项
-verbose 可以显示在命令执行的过程中,JVM都依次加载哪里Class,通过这些宝贵的调试信息,可以帮助我们分析出JVM在执行的过程中都干了些什么。

另外,自己在学习过程中,写的很多的这种破坏例程,应该有意识的分门别类的保存下来,在工作中积累的典型例程也应该定期整理,日积月累,自己就有了一个代码库了。遇到类似的问题,到代码库里面 Copy & Paste ,Search & Replace,就好了,极大提高了开发速度。最理想的情况是把一些通用的例程自己再抽象一层,形成一个通用的类库,封装好。那么可复用性就更强了。

所以我觉得其实不是特别需要例程的,自己写的破坏例程就是最好的例子,如果你实在对自己写的代码不放心的话,我强烈推荐你看看JDK基础类库的Java源代码。在JDK安装目录下面会有一个src.zip,解开来就可以完整的看到整个JDK基础类库,也就是rt.jar的Java源代码,你可以参考一下Sun是怎么写Java程序的,规范是什么样子的。我自己在学习Java的类库的时候,当有些地方理解的不是很清楚的时候,或者想更加清晰的理解运作的细节的时候,往往会打开相应的类的源代码,通过看源代码,所有的问题都会一扫而空。

Java Learning Path(五)资源篇

1、 http://java.sun.com/ (英文)
Sun的Java网站,是一个应该经常去看的地方。不用多说。

2、http://www-900.ibm.com/developerWorks/cn/
IBM的developerWorks网站,英语好的直接去英文主站点看。这里不但是一个极好的面向对象的分析设计网站,也是Web Services,Java,Linux极好的网站。强烈推荐!!!

3、http://www.javaworld.com/ (英文)
关于Java很多新技术的讨论和新闻。想多了解Java的方方面面的应用,这里比较好。

4、http://dev2dev.bea.com.cn/index.jsp
BEA的开发者园地,BEA作为最重要的App Server厂商,有很多独到的技术,在Weblogic上做开发的朋友不容错过。

5、http://www.huihoo.com/
灰狐动力网站,一个专业的中间件网站,虽然不是专业的Java网站,但是在J2EE企业应用技术方面有深厚的造诣。

6、http://www.theserverside.com/home/ (英文)
TheServerSide是一个着名的专门面向Java Server端应用的网站。

7、http://www.javaresearch.org/
Java研究组织,有很多优秀的Java方面的文章和教程,特别是在JDO方面的文章比较丰富。

8、http://www.cnjsp.org/
JSP技术网站,有相当多的Java方面的文章和资源。

9、http://www.jdon.com/
Jdon论坛,是一个个人性质的中文J2EE专业技术论坛,在众多的Java的中文论坛中,Jdon一个是技术含量非常高,帖子质量非常好的论坛。

10、http://sourceforge.net/
SourgeForge是一个开放源代码软件的大本营,其中也有非常非常丰富的Java的开放源代码的着名的软件。

参考资料:http://www.itpub.net/showthread.php?threadid=159803&pagenumber=
参考资料:http://..com/question/751730.html

3. 最经典计算机编程语言是什么

等问题。当我毫不犹豫的回答,C是最经典的最实用的计算机编程语言时他们大都愣住了。为什么不是ASM/JAVA/C++/PASCAL/LISP/C#/VB/VB.NET等这些更高级更优秀的编程语言呢? 他们的困惑我能理解。开学第一天老师就给他们发了 The High Level Language C 的英文原版教材,却没有介绍为什么学校要采用这一本教材,而且还是英文原版的,C的成功之处是什么,学了C语言能够做什么,C的前景和现状是什么,更重要的是C的未来发展前景怎样呢等等,这一切的一切教师们未曾提起。即使有先见的人去问了,得到结果也只是你自己去了解 吧!他们的课程就是从Hello, world开始的,带着一头雾气。 #include <stdio.h int main(){ printf(Hello, world ! /n);return 0;}然后,进行编译运行而已。因为这个没什么可讲的,实在体简单了。老师的授课让我们感到很遗憾的。一群渴望学习的孩子就被这样杀戮了。我们的教育制度实在很让人忧虑了。多数的教师都拥有很多的职称但是称职却寥寥无几了。 填鸭式 教育随处可见。甚至我现在一些老师还是停留在这种层次上面。由此可见,昨日的象牙塔不再光彩照人了。家长、社会都在发问,为什么? 实在让人费解我们的状况还是这样糟糕。有人认为对于学计算机专业做软件开发的人来说学一门语言(至少是这样)是很重要的。工具自然不是软件科学的核心但是对于语言学习还是很重要,只有通过语言才能和计算机进行交流,才得以表达自己的思想。所以我们的问题产生了。但是为什么C语言才是最经典的语言呢?这足以让人吃惊了,尤其对那些不太了解或者还没有接触过C语言的朋友(打面向对象的编程语言的出现,给计算机,尤其是软件事业的发展得来了一个新的时代,新的革命。好多人从生产实践中发现了面向对象的编程语言的优点和实用性、高效性、好维护性、清晰性等。所以,我多人都去学面向对象的语言去了。才会产生这样的误解,以为C就那么烦琐那么低效)。C是一门很优秀的编程语言,其结构化很好,而且用其编写的程序的运行速度还是足够快的,占用内存也很少(略高于相同功能的汇编语言程序),这是其他面向对象的高级语言无法比拟的。C是一门高级的低级语言。它有很好的体系和严格的语法以及相应的编程规范。它比汇语言更容易操作,但是不及高级语言那么简单。大概因为C语言里的bug很难发现和更正,所以好多人只是望而生畏罢了。因为她有缺点,所以才喜欢她 !。也许我不同于许多朋友之处就在于此吧。 我喜欢C语言,而且还认为她是最好的一门编程语言。 C的好处还在于我们能够操作程序的每一个细节,让整个程序按照我们的思路来执行。可以直接的操作内存,来避免不必要的错误的产生等。其实,C语言的优秀之处是有目共睹的,你的电脑操作系统,不管是Windows还是Linux或者Unix其内核都是用C来实现的,高级语言最多也就是用于开发一些应用软件罢了。尤其是在嵌入式软件开发中C表现的更加出色。当然了,这还与你的硬件环境,比如,内存的大小,和软件的应用的领域等等有很大的一层关系。 虽然,包括微软等公司和个人都在尽一切的可能来开发基于高级语言的操作系统,比如微软longhorn,来说明高级语言的高效、健壮等特性,但是我们还没有见到最后的结果。现在言论实在太早了。汇编语言很不错,但是能够把握汇编语言的人实在太少了。因为它结构很混乱,逻辑很差等。 我相信,总有一天大家都会发现只有C才是最经典的计算机编程语言。我希望那些想通过学习一门优秀的语言来了解和把握计算机科学的同学朋友们尽早的改变自己的错误的观念。语言只是一种工具,最重要的还是计算机理论知识。这是没有一门语言足够表达的。领域知识的积累对一个人的职业生涯起着一个决定性的作用。

4. C语言的经典编程例子

//最经典的当然是HelloWorld了。
#include"stdio.h"
intmain(void)
{
printf("HelloWorld! ");
}

5. 有哪些和编程有关的经典语句

  1. One man's constant is another man's variable.

  2. Functions delay binding: data structures ince binding. Moral: Structure data late in the programming process.

  3. Syntactic sugar causes cancer of the semi-colons.

  4. Every program is a part of some other program and rarely fits.

  5. If a program manipulates a large amount of data, it does so in a small number of ways.

  6. Symmetry is a complexity recing concept (co-routines include sub-routines); seek it everywhere.

  7. It is easier to write an incorrect program than understand a correct one.

  8. A programming language is low level when its programs require attention to the irrelevant.

  9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.

  10. Get
    into a rut early: Do the same processes the same way. Accumulate
    idioms. Standardize. The only difference (!) between Shakespeare and you
    was the size of his idiom list - not the size of his vocabulary.

  11. If you have a procere with 10 parameters, you probably missed some.

  12. Recursion is the root of computation since it trades description for time.

  13. If two people write exactly the same program, each should be put in micro-code and then they certainly won't be the same.

  14. In the long run every program becomes rococo - then rubble.

  15. Everything should be built top-down, except the first time.

  16. Every program has (at least) two purposes: the one for which it was written and another for which it wasn't.

  17. If a listener nods his head when you're explaining your program, wake him up.

  18. A program without a loop and a structured variable isn't worth writing.

  19. A language that doesn't affect the way you think about programming, is not worth knowing.

  20. Wherever
    there is molarity there is the potential for misunderstanding: Hiding
    information implies a need to check communication.

  21. Optimization hinders evolution.

  22. A good system can't have a weak command language.

  23. To understand a program you must become both the machine and the program.

  24. Perhaps if we wrote programs from childhood on, as alts we'd be able to read them.

  25. One
    can only display complex information in the mind. Like seeing, movement
    or flow or alteration of view is more important than the static
    picture, no matter how lovely.

  26. There will always be things we wish to say in our programs that in all known languages can only be said poorly.

  27. Once you understand how to write a program get someone else to write it.

  28. Around
    computers it is difficult to find the correct unit of time to measure
    progress. Some cathedrals took a century to complete. Can you imagine
    the grandeur and scope of a program that would take as long?

  29. For
    systems, the analogue of a face-lift is to add to the control graph an
    edge that creates a cycle, not just an additional node.

  30. In programming, everything we do is a special case of something more general - and often we know it too quickly.

  31. Simplicity does not precede complexity, but follows it.

  32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.

  33. The 11th commandment was "Thou Shalt Compute" or "Thou Shalt Not Compute" - I forget which.

  34. The
    string is a stark data structure and everywhere it is passed there is
    much plication of process. It is a perfect vehicle for hiding
    information.

  35. Everyone can be taught to sculpt: Michelangelo would have had to be taught how not to. So it is with the great programmers.

  36. The
    use of a program to prove the 4-color theorem will not change
    mathematics - it merely demonstrates that the theorem, a challenge for a
    century, is probably not important to mathematics.

  37. The
    most important computer is the one that rages in our skulls and ever
    seeks that satisfactory external emulator. The standardization of real
    computers would be a disaster - and so it probably won't happen.

  38. Structured Programming supports the law of the excluded muddle.

  39. Re
    graphics: A picture is worth 10K words - but only those to describe the
    picture. Hardly any sets of 10K words can be adequately described with
    pictures.

  40. There are two ways to write error-free programs; only the third one works.

  41. Some programming languages manage to absorb change, but withstand progress.

  42. You can measure a programmer's perspective by noting his attitude on the continuing vitality of FORTRAN.

  43. In software systems it is often the early bird that makes the worm.

  44. Sometimes I think the only universal in the computing field is the fetch-execute-cycle.

  45. The goal of computation is the emulation of our synthetic abilities, not the understanding of our analytic ones.

  46. Like punning, programming is a play on words.

  47. As Will Rogers would have said, "There is no such thing as a free variable."

  48. The
    best book on programming for the layman is "Alice in Wonderland"; but
    that's because it's the best book on anything for the layman.

  49. Giving
    up on assembly language was the apple in our Garden of Eden: Languages
    whose use squanders machine cycles are sinful. The LISP machine now
    permits LISP programmers to abandon bra and fig-leaf.

  50. When we understand knowledge-based systems, it will be as before - except our finger-tips will have been singed.

  51. Bringing computers into the home won't change either one, but may revitalize the corner saloon.

  52. Systems have sub-systems and sub-systems have sub-systems and so on ad infinitum - which is why we're always starting over.

  53. So many good ideas are never heard from again once they embark in a voyage on the semantic gulf.

  54. Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy.

  55. A LISP programmer knows the value of everything, but the cost of nothing.

  56. Software is under a constant tension. Being symbolic it is arbitrarily perfectible; but also it is arbitrarily changeable.

  57. It is easier to change the specification to fit the program than vice versa.

  58. Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

  59. In English every word can be verbed. Would that it were so in our programming languages.

  60. Dana Scott is the Church of the Lattice-Way Saints.

  61. In programming, as in everything else, to be in error is to be reborn.

  62. In computing, invariants are ephemeral.

  63. When we write programs that "learn", it turns out we do and they don't.

  64. Often it is means that justify ends: Goals advance technique and technique survives even when goal structures crumble.

  65. Make
    no mistake about it: Computers process numbers - not symbols. We
    measure our understanding (and control) by the extent to which we can
    arithmetize an activity.

  66. Making something variable is easy. Controlling ration of constancy is the trick.

  67. Think of all the psychic energy expended in seeking a fundamental distinction between "algorithm" and "program".

  68. If
    we believe in data structures, we must believe in independent (hence
    simultaneous) processing. For why else would we collect items within a
    structure? Why do we tolerate languages that give us the one without the
    other?

  69. In a 5 year period we get one superb programming language. Only we can't control when the 5 year period will begin.

  70. Over
    the centuries the Indians developed sign language for communicating
    phenomena of interest. Programmers from different tribes (FORTRAN, LISP,
    ALGOL, SNOBOL, etc.) could use one that doesn't require them to carry a
    blackboard on their ponies.

  71. Documentation is like term insurance: It satisfies because almost no one who subscribes to it depends on its benefits.

  72. An adequate bootstrap is a contradiction in terms.

  73. It
    is not a language's weaknesses but its strengths that control the
    gradient of its change: Alas, a language never escapes its embryonic
    sac.

  74. It is possible that software is not like anything
    else, that it is meant to be discarded: that the whole point is to
    always see it as soap bubble?

  75. Because of its vitality, the computing field is always in desperate need of new cliches: Banality soothes our nerves.

  76. It is the user who should parameterize proceres, not their creators.

  77. The
    cybernetic exchange between man, computer and algorithm is like a game
    of musical chairs: The frantic search for balance always leaves one of
    the three standing ill at ease.

6. java经典编程案例有哪些

  1. java编程的记事本:

    import java.util.*;
    public class JieChengExample
    {
    public static void main(String args[])
    {
    Scanner input=new Scanner(System.in);
    int n,sum;
    Jiecheng jie=new Jiecheng();
    System.out.print("输入n的值:");//输入有几个阶乘相加
    n=input.nextInt();
    sum=0;
    for(int i=1;i<=n;i++)
    {
    sum=sum+jie.jiecheng(i);//这是n个阶乘相加
    }
    System.out.println("1!+2!+3!+....+n!的和是:"+sum);
    }
    }
    class Jiecheng
    {
    public int jiecheng(int temp)//算阶乘的方法
    {
    int sum=1;
    for(int i=1;i<=temp;i++)
    {
    sum=sum*i; //计算阶乘
    }
    return sum;//将一个阶乘返回
    }
    }

2.java赛马游戏:

import java.util.Random;
public class Test {
public static void main(String[] args) {
Competition c = new Competition();
Thread T = new Thread(c);
T.start();
}
}
class Competition implements Runnable{
int red = 0;
int green = 0;
int Speed [] = new int [2];
Competition(){

}
public void run(){
Random r = new Random();
for(int a= 0;a<500;a++){
for(int j = 0;j<2;j++){
Speed[j] = r.nextInt(2);
red = red + Speed[j];
Speed[j] = r.nextInt(2);
green = green + Speed[j];
}
System.out.println("red的速度为"+red);
System.out.println("green的速度为"+green);
while(red >=500 || green>=500){
if(red >=500){
System.out.println("red先抵达终点线");
}
if(green >= 500){
System.out.println("green先抵达终点线");
}
if(green ==500 && red ==500 ){
System.out.println("两个同时到达");
}
return;
}
}
/* if(red >green){
System.out.println("Redwin"+red);
}
if(red<green){
S...import java.util.Random;
public class Test {
public static void main(String[] args) {
Competition c = new Competition();
Thread T = new Thread(c);
T.start();
}
}
class Competition implements Runnable{
int red = 0;
int green = 0;
int Speed [] = new int [2];
Competition(){

}
public void run(){
Random r = new Random();
for(int a= 0;a<500;a++){
for(int j = 0;j<2;j++){
Speed[j] = r.nextInt(2);
red = red + Speed[j];
Speed[j] = r.nextInt(2);
green = green + Speed[j];
}
System.out.println("red的速度为"+red);
System.out.println("green的速度为"+green);
while(red >=500 || green>=500){
if(red >=500){
System.out.println("red先抵达终点线");
}
if(green >= 500){
System.out.println("green先抵达终点线");
}
if(green ==500 && red ==500 ){
System.out.println("两个同时到达");
}
return;
}
}
/* if(red >green){
System.out.println("Redwin"+red);
}
if(red<green){
System.out.println("Greenwin"+green);
}
if(red == green){
System.out.println("equal");*/

JAVA的介绍:

Java是一种可以撰写跨平台应用程序的面向对象的程序设计语言。Java技术具有卓越的通用性、高效性、平台移植性和安全性,广泛应用于PC、数据中心、游戏控制台、科学超级计算机、移动电话和互联网,同时拥有全球最大的开发者专业社群。

7. 最经典的C语言编程软件是什么

个人推荐~初学者使用VC/VC++~!当然MSDN是必须要安装的!
如果有兴趣的话,建议LZ看看VB,相当简单,超级好学~

8. 哪个编程语言最好

编程语言最好:
一、Java最流行
与一年前一样,Java仍然是最流行的编程语言。据TIOBE的数据显示,几十年来,Java比其他语言更常名列榜首。许多知名公司使用Java来开发软件和应用程序,所以如果你碰巧使用Java,绝对不必为找工作而苦恼。Java受欢迎的主要原因是它拥有可移植性、可扩展性和庞大的用户社区。
二、经典的C语言
作为最古老的编程语言之一,C依然高居榜首,这归功于其可移植性以及微软、Oracle和苹果等科技巨头采用它。它与几乎所有系统兼容,很适合操作系统和嵌入式系统。
由于运行时环境相对小巧,因此C是保持这种系统精简的完美选择。强烈建议初学者学C,它实际上是编程语言的通用语言,已催生出了同样很受欢迎的衍生语言,比如C++和C#。
三、C ++继续占主导地位
这种面向对象编程语言在20世纪80年代开发而成,现在仍应用于从桌面Web应用程序到服务器基础设施的众多系统。由于灵活性、高性能以及可用于多种环境,C ++依然很吃香。以C++为业的工作通常需要开发面向性能密集型任务的桌面应用程序。掌握C++可以更深入地了解编程语言,帮助获得低级内存处理方面的技能。
四、Python:不断上升
过去15年来,Python的受欢迎程度稳步上升。过去这几年,它一直能够跻身TIOBE指数前5名的位置。作为如今人工智能、机器学习、大数据和机器人等一些最有前途的技术背后的主要语言,Python近年来积累了庞大的粉丝群。你会惊讶地发现学习Python很容易,这就是为什么许多经验丰富的开发人员选择Python作为第二或第三语言的原因。

9. 经典C语言编程30例(二)

【程序31】
题目:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续
判断第二个字母。
1.程序分析:用情况语句比较好,如果第一个字母一样,则判断用情况语句或if语句判断第二个字母。
2.程序源代码:
#include
void main()
{
char letter;
printf("please input the first letter of someday\n");
while ((letter=getch())!='Y')/*当所按字母为Y时才结束*/
{ switch (letter)
{case 'S':printf("please input second letter\n");
if((letter=getch())=='a')
printf("saturday\n");
else if ((letter=getch())=='u')
printf("sunday\n");
else printf("data error\n");
break;
case 'F':printf("friday\n");break;
case 'M':printf("monday\n");break;
case 'T':printf("please input second letter\n");
if((letter=getch())=='u')
printf("tuesday\n");
else if ((letter=getch())=='h')
printf("thursday\n");
else printf("data error\n");
break;
case 'W':printf("wednesday\n");break;
default: printf("data error\n");
}
}
}
==============================================================
【程序32】
题目:Press any key to change color, do you want to try it. Please hurry up!
1.程序分析:
2.程序源代码:
#include
void main(void)
{
int color;
for (color = 0; color < 8; color++)
{
textbackground(color);/*设置文本的背景颜色*/
cprintf("This is color %d\r\n", color);
cprintf("Press any key to continue\r\n");
getch();/*输入字符看不见*/
}
}
==============================================================
【程序33】
题目:学习gotoxy()与clrscr()函数
1.程序分析:
2.程序源代码:
#include
void main(void)
{
clrscr();/*清屏函数*/
textbackground(2);
gotoxy(1, 5);/*定位函数*/
cprintf("Output at row 5 column 1\n");
textbackground(3);
gotoxy(20, 10);
cprintf("Output at row 10 column 20\n");
}
==============================================================
【程序34】
题目:练习函数调用
1. 程序分析:
2.程序源代码:
#include
void hello_world(void)
{
printf("Hello, world!\n");
}
void three_hellos(void)
{
int counter;
for (counter = 1; counter <= 3; counter++)
hello_world();/*调用此函数*/
}
void main(void)
{
three_hellos();/*调用此函数*/
}
==============================================================
【程序35】
题目:文本颜色设置
1.程序分析:
2.程序源代码:
#include
void main(void)
{
int color;
for (color = 1; color < 16; color++)
{
textcolor(color);/*设置文本颜色*/
cprintf("This is color %d\r\n", color);
}
textcolor(128 + 15);
cprintf("This is blinking\r\n");
}
==============================================================
【程序36】
题目:求100之内的素数
1.程序分析:
2.程序源代码:
#include
#include "math.h"
#define N 101
main()
{
int i,j,line,a[N];
for(i=2;ifor(i=2;i for(j=i+1;j {
if(a[i]!=0&&a[j]!=0)
if(a[j]%a[i]==0)
a[j]=0;}
printf("\n");
for(i=2,line=0;i{
if(a[i]!=0)
{printf("]",a[i]);
line++;}
if(line==10)
{printf("\n");
line=0;}
}
}
==============================================================
【程序37】
题目:对10个数进行排序
1.程序分析:可以利用选择法,即从后9个比较过程中,选择一个最小的与第一个元素交换,
下次类推,即用第二个元素与后8个进行比较,并进行交换。
2.程序源代码:
#define N 10
main()
{int i,j,min,tem,a[N];
/*input data*/
printf("please input ten num:\n");
for(i=0;i{
printf("a[%d]=",i);
scanf("%d",&a[i]);}
printf("\n");
for(i=0;iprintf("]",a[i]);
printf("\n");
/*sort ten num*/
for(i=0;i{min=i;
for(j=i+1;jif(a[min]>a[j]) min=j;
tem=a[i];
a[i]=a[min];
a[min]=tem;
}
/*output data*/
printf("After sorted \n");
for(i=0;iprintf("]",a[i]);
}
==============================================================
【程序38】
题目:求一个3*3矩阵对角线元素之和
1.程序分析:利用双重for循环控制输入二维数组,再将a[i][i]累加后输出。
2.程序源代码:
main()
{
float a[3][3],sum=0;
int i,j;
printf("please input rectangle element:\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%f",&a[i][j]);
for(i=0;i<3;i++)
sum=sum+a[i][i];
printf("ijiaoxian he is %6.2f",sum);
}
==============================================================
【程序39】
题目:有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中。
1. 程序分析:首先判断此数是否大于最后一个数,然后再考虑插入中间的数的情况,插入后
此元素之后的数,依次后移一个位置。
2.程序源代码:
main()
{
int a[11]={1,4,6,9,13,16,19,28,40,100};
int temp1,temp2,number,end,i,j;
printf("original array is:\n");
for(i=0;i<10;i++)
printf("]",a[i]);
printf("\n");
printf("insert a new number:");
scanf("%d",&number);
end=a[9];
if(number>end)
a[10]=number;
else
{for(i=0;i<10;i++)
{ if(a[i]>number)
{temp1=a[i];
a[i]=number;
for(j=i+1;j<11;j++)
{temp2=a[j];
a[j]=temp1;
temp1=temp2;
}
break;
}
}
}
for(i=0;i<11;i++)
printf("m",a[i]);
}
==============================================================
【程序40】
题目:将一个数组逆序输出。
1.程序分析:用第一个与最后一个交换。
2.程序源代码:
#define N 5
main()
{ int a[N]={9,6,5,4,1},i,temp;
printf("\n original array:\n");
for(i=0;i printf("M",a[i]);
for(i=0;i {temp=a[i];
a[i]=a[N-i-1];
a[N-i-1]=temp;
}
printf("\n sorted array:\n");
for(i=0;i printf("M",a[i]);
}
【程序41】
题目:学习static定义静态变量的用法
1.程序分析:
2.程序源代码:
#include "stdio.h"
varfunc()
{
int var=0;
static int static_var=0;
printf("\40:var equal %d \n",var);
printf("\40:static var equal %d \n",static_var);
printf("\n");
var++;
static_var++;
}
void main()
{int i;
for(i=0;i<3;i++)
varfunc();
}
==============================================================
【程序42】
题目:学习使用auto定义变量的用法
1.程序分析:
2.程序源代码:
#include "stdio.h"
main()
{int i,num;
num=2;
for (i=0;i<3;i++)
{ printf("\40: The num equal %d \n",num);
num++;
{
auto int num=1;
printf("\40: The internal block num equal %d \n",num);
num++;
}
}
}
==============================================================
【程序43】
题目:学习使用static的另一用法。
1.程序分析:
2.程序源代码:
#include "stdio.h"
main()
{
int i,num;
num=2;
for(i=0;i<3;i++)
{
printf("\40: The num equal %d \n",num);
num++;
{
static int num=1;
printf("\40:The internal block num equal %d\n",num);
num++;
}
}
}
==============================================================
【程序44】
题目:学习使用external的用法。
1.程序分析:
2.程序源代码:
#include "stdio.h"
int a,b,c;
void add()
{ int a;
a=3;
c=a+b;
}
void main()
{ a=b=4;
add();
printf("The value of c is equal to %d\n",c);
}
==============================================================
【程序45】
题目:学习使用register定义变量的方法。
1.程序分析:
2.程序源代码:
void main()
{
register int i;
int tmp=0;
for(i=1;i<=100;i++)
tmp+=i;
printf("The sum is %d\n",tmp);
}
==============================================================
【程序46】
题目:宏#define命令练习(1)
1.程序分析:
2.程序源代码:
#include "stdio.h"
#define TRUE 1
#define FALSE 0
#define SQ(x) (x)*(x)
void main()
{
int num;
int again=1;
printf("\40: Program will stop if input value less than 50.\n");
while(again)
{
printf("\40:Please input number==>");
scanf("%d",&num);
printf("\40:The square for this number is %d \n",SQ(num));
if(num>=50)
again=TRUE;
else
again=FALSE;
}
}
==============================================================
【程序47】
题目:宏#define命令练习(2)
1.程序分析:
2.程序源代码:
#include "stdio.h"
#define exchange(a,b) { \ /*宏定义中允许包含两道衣裳命令的情形,此时必须在最右边加上"\"*/
int t;\
t=a;\
a=b;\
b=t;\
}
void main(void)
{
int x=10;
int y=20;
printf("x=%d; y=%d\n",x,y);
exchange(x,y);
printf("x=%d; y=%d\n",x,y);
}
==============================================================
【程序48】
题目:宏#define命令练习(3)
1.程序分析:
2.程序源代码:
#define LAG >
#define SMA <
#define EQ ==
#include "stdio.h"
void main()
{ int i=10;
int j=20;
if(i LAG j)
printf("\40: %d larger than %d \n",i,j);
else if(i EQ j)
printf("\40: %d equal to %d \n",i,j);
else if(i SMA j)
printf("\40:%d smaller than %d \n",i,j);
else
printf("\40: No such value.\n");
}
==============================================================
【程序49】
题目:#if #ifdef和#ifndef的综合应用。
1. 程序分析:
2.程序源代码:
#include "stdio.h"
#define MAX
#define MAXIMUM(x,y) (x>y)?x:y
#define MINIMUM(x,y) (x>y)?y:x
void main()
{ int a=10,b=20;
#ifdef MAX
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#else
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#endif
#ifndef MIN
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#else
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#endif
#undef MAX
#ifdef MAX
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#else
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#endif
#define MIN
#ifndef MIN
printf("\40: The lower one is %d\n",MINIMUM(a,b));
#else
printf("\40: The larger one is %d\n",MAXIMUM(a,b));
#endif
}
==============================================================
【程序50】
题目:#include 的应用练习
1.程序分析:
2.程序源代码:
test.h 文件如下:
#define LAG >
#define SMA <
#define EQ ==
#include "test.h" /*一个新文件50.c,包含test.h*/
#include "stdio.h"
void main()
{ int i=10;
int j=20;
if(i LAG j)
printf("\40: %d larger than %d \n",i,j);
else if(i EQ j)
printf("\40: %d equal to %d \n",i,j);
else if(i SMA j)
printf("\40:%d smaller than %d \n",i,j);
else
printf("\40: No such value.\n");
}
【程序51】
题目:学习使用按位与 & 。
1.程序分析:0&0=0; 0&1=0; 1&0=0; 1&1=1
2.程序源代码:
#include "stdio.h"
main()
{
int a,b;
a=077;
b=a&3;
printf("\40: The a & b(decimal) is %d \n",b);
b&=7;
printf("\40: The a & b(decimal) is %d \n",b);
}
==============================================================
【程序52】
题目:学习使用按位或 | 。
1.程序分析:0|0=0; 0|1=1; 1|0=1; 1|1=1
2.程序源代码:
#include "stdio.h"
main()
{
int a,b;
a=077;
b=a|3;
printf("\40: The a & b(decimal) is %d \n",b);
b|=7;
printf("\40: The a & b(decimal) is %d \n",b);
}
==============================================================
【程序53】
题目:学习使用按位异或 ^ 。
1.程序分析:0^0=0; 0^1=1; 1^0=1; 1^1=0
2.程序源代码:
#include "stdio.h"
main()
{
int a,b;
a=077;
b=a^3;
printf("\40: The a & b(decimal) is %d \n",b);
b^=7;
printf("\40: The a & b(decimal) is %d \n",b);
}
==============================================================
【程序54】
题目:取一个整数a从右端开始的4~7位。
程序分析:可以这样考虑:
(1)先使a右移4位。
(2)设置一个低4位全为1,其余全为0的数。可用~(~0<<4)
(3)将上面二者进行&运算。
2.程序源代码:
main()
{
unsigned a,b,c,d;
scanf("%o",&a);
b=a>>4;
c=~(~0<<4);
d=b&c;
printf("%o\n%o\n",a,d);
}
==============================================================
【程序55】
题目:学习使用按位取反~。
1.程序分析:~0=1; ~1=0;
2.程序源代码:
#include "stdio.h"
main()
{
int a,b;
a=234;
b=~a;
printf("\40: The a's 1 complement(decimal) is %d \n",b);
a=~a;
printf("\40: The a's 1 complement(hexidecimal) is %x \n",a);
}
==============================================================
【程序56】
题目:画图,学用circle画圆形。
1.程序分析:
2.程序源代码:
/*circle*/
#include "graphics.h"
main()
{int driver,mode,i;
float j=1,k=1;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
for(i=0;i<=25;i++)
{
setcolor(8);
circle(310,250,k);
k=k+j;
j=j+0.3;
}
}
==============================================================
【程序57】
题目:画图,学用line画直线。
1.程序分析:
2.程序源代码:
#include "graphics.h"
main()
{int driver,mode,i;
float x0,y0,y1,x1;
float j=12,k;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(GREEN);
x0=263;y0=263;y1=275;x1=275;
for(i=0;i<=18;i++)
{
setcolor(5);
line(x0,y0,x0,y1);
x0=x0-5;
y0=y0-5;
x1=x1+5;
y1=y1+5;
j=j+10;
}
x0=263;y1=275;y0=263;
for(i=0;i<=20;i++)
{
setcolor(5);
line(x0,y0,x0,y1);
x0=x0+5;
y0=y0+5;
y1=y1-5;
}
}
==============================================================
【程序58】
题目:画图,学用rectangle画方形。
1.程序分析:利用for循环控制100-999个数,每个数分解出个位,十位,百位。
2.程序源代码:
#include "graphics.h"
main()
{int x0,y0,y1,x1,driver,mode,i;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
x0=263;y0=263;y1=275;x1=275;
for(i=0;i<=18;i++)
{
setcolor(1);
rectangle(x0,y0,x1,y1);
x0=x0-5;
y0=y0-5;
x1=x1+5;
y1=y1+5;
}
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(150,40,"How beautiful it is!");
line(130,60,480,60);
setcolor(2);
circle(269,269,137);
}
==============================================================
【程序59】
题目:画图,综合例子。
1.程序分析:
2.程序源代码:
# define PAI 3.1415926
# define B 0.809
# include "graphics.h"
#include "math.h"
main()
{
int i,j,k,x0,y0,x,y,driver,mode;
float a;
driver=CGA;mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(3);
setbkcolor(GREEN);
x0=150;y0=100;
circle(x0,y0,10);
circle(x0,y0,20);
circle(x0,y0,50);
for(i=0;i<16;i++)
{
a=(2*PAI/16)*i;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a)*B);
setcolor(2); line(x0,y0,x,y);}
setcolor(3);circle(x0,y0,60);
/* Make 0 time normal size letters */
settextstyle(DEFAULT_FONT,HORIZ_DIR,0);
outtextxy(10,170,"press a key");
getch();
setfillstyle(HATCH_FILL,YELLOW);
floodfill(202,100,WHITE);
getch();
for(k=0;k<=500;k++)
{
setcolor(3);
for(i=0;i<=16;i++)
{
a=(2*PAI/16)*i+(2*PAI/180)*k;
x=ceil(x0+48*cos(a));
y=ceil(y0+48+sin(a)*B);
setcolor(2); line(x0,y0,x,y);
}
for(j=1;j<=50;j++)
{
a=(2*PAI/16)*i+(2*PAI/180)*k-1;
x=ceil(x0+48*cos(a));
y=ceil(y0+48*sin(a)*B);
line(x0,y0,x,y);
}
}
restorecrtmode();
}
==============================================================
【程序60】
题目:画图,综合例子。
1.程序分析:
2.程序源代码:
#include "graphics.h"
#define LEFT 0
#define TOP 0
#define RIGHT 639
#define BOTTOM 479
#define LINES 400
#define MAXCOLOR 15
main()
{
int driver,mode,error;
int x1,y1;
int x2,y2;
int dx1,dy1,dx2,dy2,i=1;
int count=0;
int color=0;
driver=VGA;
mode=VGAHI;
initgraph(&driver,&mode,"");
x1=x2=y1=y2=10;
dx1=dy1=2;
dx2=dy2=3;
while(!kbhit())
{
line(x1,y1,x2,y2);
x1+=dx1;y1+=dy1;
x2+=dx2;y2+dy2;
if(x1<=LEFT||x1>=RIGHT)
dx1=-dx1;
if(y1<=TOP||y1>=BOTTOM)
dy1=-dy1;
if(x2<=LEFT||x2>=RIGHT)
dx2=-dx2;
if(y2<=TOP||y2>=BOTTOM)
dy2=-dy2;
if(++count>LINES)
{
setcolor(color);
color=(color>=MAXCOLOR)?0:++color;
}
}
closegraph();
}

10. 谁发明了那些经典的编程语言

我也抄一下。
奥古斯塔·阿达·金,勒芙蕾丝伯爵夫人(augusta
ada
king,
countess
of
lovelace,1815年12月10日-1852年11月27日),原名奥古斯塔·阿达·拜伦(augusta
ada
byron),通称阿达·洛芙莱斯(ada
lovelace),是着名英国诗人拜伦之女,数学家。计算机程序创始人,建立了循环和子程序概念。
为计算程序拟定“算法”,写作的第一份“程序设计流程图”,被珍视为“第一位给计算机写程序的人”。为了纪念阿达·奥古斯塔对现代电脑与软件工程所产生的重大影响,美国国防部将耗费巨资、历时近20年研制成功的高级程序语言命名为ada语言,它被公认为是第四代计算机语言的主要代表。
在1842年,人称“数字女王”的阿达·洛芙莱斯(ada
lovelace)编写了历史上首款电脑程序。
在1834年,阿达的朋友——英国数学家、发明家兼机械工程师查尔斯·巴贝其(charles
babbage)——发明了一台分析机;阿达则致力于为该分析机编写算法,并于1843
年公布了世界上第一套算法。
巴贝其分析机后来被认为是最早期的计算机雏形,而阿达的算法则被认为是最早的计算机程序和软件。
1852年,阿达为了治疗子宫颈癌,却因此死于失血过多,得年36岁。无独有偶,她与她父亲拜伦死于相同年龄,一样死于治疗中的失血过多。她留下了两个儿子与一位女儿—安妮·布兰特贵女。
依她的遗言,阿达葬于诺丁汉哈克诺的圣
玛丽亚·抹大拉教堂,长眠在父亲的身旁。
在1842年与1843年其间,阿达花了9个月的时间翻译意大利数学家路易吉·米那比亚对巴贝奇最新的计算机设计书(即分析机概论)所留下的备忘录。在这部译文里,她附加许多注记,内容详细说明用计算机进行伯努利数的运算方式,而被认为是世界上第一个电脑程式;因此,阿达也被认为是世界上第一位程式设计师。巴贝奇在他所着的《经过哲学家人生》(passages
from
the
life
of
a
philosopher,
1846)里留有下面的述叙:
伦敦科学馆分析机复制品
“我认为她为米那比亚的备忘录增加许多注记,并加入了一些想法。虽然这些想法是由我们一起讨论出来的,但是最后被写进注记里的想法确确实实是她自己的构想。我将许多代数运算的问题交给她处理,这些工作也与伯努利数的运算相关。在她所送回给我的文件,更修正了我先前在程序里的重大错误。”
阿达的文章创造出许多巴贝奇也未曾提到的新构想,比如阿达曾经预言道:“这个机器未来可以用来排版、编曲或是各种更复杂的用途。”
她死后一百年,于1953年,阿达之前对查尔斯·巴贝奇的《分析机概论》所留下的笔记被重新公布,并被公认对现代计算机与软件工程造成了重大影响。[2]
在1980年12月10日,美国国防部制作了一个新的高级计算机编程语言——ada,以纪念阿达·洛芙莱斯。
在微软的wins产品里也可以找到阿达的全息图标签。
英国计算机公会每年都颁发以阿达命名的软件工程创新大奖。

热点内容
电脑改群晖服务器 发布:2024-05-06 07:57:19 浏览:38
冒险岛忘记服务器了怎么查 发布:2024-05-06 07:53:42 浏览:240
茶叶数据库 发布:2024-05-06 07:52:16 浏览:311
服务器web访问端口怎么查看 发布:2024-05-06 07:35:28 浏览:226
苹果id改密码要什么条件 发布:2024-05-06 07:34:47 浏览:805
镇江节点服务器测试ip 发布:2024-05-06 07:15:05 浏览:540
sqlserver表格 发布:2024-05-06 07:09:54 浏览:612
雪铁龙凡尔赛选哪个配置 发布:2024-05-06 06:56:04 浏览:571
福睿斯配置怎么样 发布:2024-05-06 06:50:16 浏览:103
微生物数据库 发布:2024-05-06 06:47:33 浏览:605