编程素养-Day013

JavaScript 编程题

谈谈你对Ajax 的理解?(概念、特点、作用)
AJAX 全称为「Asynchronous JavaScript And XML」(异步 JavaScript 和 XML) 是指一种创建交互式网页应用的开发技术、改善用户体验,实现无刷新效果。
优点

  • 无刷新更新数据,能在不刷新整个页面的前提下与服务器通信维护数据;
  • 异步与服务器通信,不需要打断用户的操作,具有更加迅速的响应能力;
  • 提高 Web 程序的性能;
  • 基于标准被广泛支持,不需要下载插件;

缺点

  • 破坏浏览器「前进」、「后退」按钮的正常功能,可以通过简单的插件弥补;
  • 对搜索引擎的支持不足;

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 教师号  

Java 编程题

有一对兔子,从出生后第 3 个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问第 10 个月的兔子总数为多少?

package test;

public class Day013 {
	public static void main(String[] args) {
		int n = 10;
		System.out.println("第" + n + "个月兔子总数为" + fun(n));
	}
	public static int fun(int n) {
		if (n == 1 || n == 2) {
			return 1;
		} else {
			return fun(n - 1) + fun(n - 2);
		}
	}
}

猜你喜欢

转载自blog.csdn.net/aensd_aqbly/article/details/83422232