JavaScript 编程题
谈谈你对Ajax 的理解?(概念、特点、作用)
MySQL 编程题
Java 编程题
有一对兔子,从出生后第 3 个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问第 10 个月的兔子总数为多少?
1.js
1、概念:AJAX 全称为「Asynchronous JavaScript And XML」(异步 JavaScript 和 XML) 是指一种创建交互式网页应用的开发技术、改善用户体验,实现无刷新效果。
2、异步请求,不需要打断用户的操作,具有更加迅速的响应能力;
3、局部刷新,能在不刷新整个页面的前提下与服务器通信维护数据;
缺点
a、破坏浏览器「前进」、「后退」按钮的正常功能,可以通过简单的插件弥补;
b、对搜索引擎的支持不足;
2.mysql
select 教师号,
sum(case when 星期号=1 and 是否有课='有' then 1 else 0 end) AS 星期一,
sum(case when 星期号=2 and 是否有课='有' then 1 else 0 end) AS 星期二,
sum(case when 星期号=3 and 是否有课='有' then 1 else 0 end) AS 星期三
from teacher_course
group by 教师号
3.java
public class Index {
/**
* 第一个月 2只
* 第二个月 2只
* 第三个月 2+2=4
* 第四个月 2+2+2=6
* 第五个月 2+2+2+2+2=10
* 第六个月 2+2+2+2+2+2+2+2=16
* 第n个月 前两月个月的和
* @param d
* @return
*/
public int fun(int d) {
int sum = 0;
for(int i = 1; i <=d; i++) {
if(i == 1 || i == 2) {
sum = 2;
}else {
sum = fun(i-1)+fun(i-2);
}
}
return sum;
}
public static void main(String[] args) {
Index in = new Index();
System.out.println(in.fun(10));
}
}