摘要: 测试递归与循环(这里用for)的执行效率与系统开销,首先贴出实例问题:实现Fibonacci数列F(n)=F(n-1)+ F(n-2)测试环境 Eclipse1.首先我们用递归来实现 1 package com.youfeng.test; 2 3 public class Fab {//递归 4 public static void main(String [] args){ 5 System.out.println(F(40)); 6 } 7 public static Long F(int index){ 8 if(index==1||index==2){ 9 ... 阅读全文
posted @ 2011-12-23 10:55 Angry Jerry 阅读(2748) 评论(9) 推荐(1) 编辑
 
摘要: 一、准备①下载httpd-2.2.21.tar.gz②下载apache-tomcat-7.0.23.tar.gz③下载tomcat-connectors-1.2.32-src.tar.gz连接二、安装①安装apache:解压:tarzxvfhttpd-2.2.21.tar.gz改名:mvhttpd-2.2.21apache#./configure--prefix=/002/apache#make#makeinstall②安装tomcatTomcat无需安装解压就可以直接运行③编译安装tomcat-connectors-1.2.32-src.tar.gz1.解压:tarzxvftomcat-co 阅读全文
posted @ 2011-12-20 15:20 Angry Jerry 阅读(1415) 评论(0) 推荐(1) 编辑
  2011年5月30日
摘要: 字符串可以用字符数组与字符串变量两种方式来存储,效果类似。一、用字符数组来存储字符串:char st1[100],st2[100] ;//字符数组说明cin>>st1>>st2;long a,b;输入:hello, world则st1={‘h’,’e’,’l’,’l’,’o’,’,’,’\0’}st2={‘w’,’o’,’r’,’l’,’d’,’\0}字符’\0’为字符串结束标志1. 字符数组长度 strlen(st1); //如a=strlen(st1);b=strlen(st2); 则a=6,b=52. 字符数组比较 不能直接比较,st1>st2是错误的,要用 阅读全文
posted @ 2011-05-30 08:44 Angry Jerry 阅读(328) 评论(0) 推荐(0) 编辑