JavaScript
1、创建新节点
创建一个具体的元素: createElement()
创建一个文本节点:createTextNode()
2、添加、移除、替换、插入
添加:appendChild()
移除:removeChild()
替换:replaceChild()
插入:insertBefore() 在已有的子节点前插入一个新的子节点
3、查找
通过标签名称:getElementsByTagName()
通过元素的Name属性的值:getElementsByName()
通过元素Id:getElementById()
MySQL
CREATE TABLE food(
id INT PRIMARY KEY NOT NULL UNIQUE AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
company VARCHAR(30) NOT NULL,
price FLOAT,
produce_time YEAR,
validity_time INT,
address VARCHAR(50)
);
INSERT INTO food
VALUES(NULL,'AA饼干','AA饼干厂', 2.5 ,'2013', 3 ,'北京');
UPDATE food SET address='内蒙古',price=3.2 WHERE name='CC牛奶';
UPDATE food SET validity_time=5 WHERE address='北京';
DELETE FROM food WHERE validity_time < (2017-produce_time);
DELETE FROM food WHERE address='北京';
Java
package test;
public class Day014 {
public static void main(String[] args) {
System.out.println("兑换方式如下:");
int a, b, c, count = 0;
for (a = 0; a <= 10; a++)
for (b = 0; b <= 20; b++)
for (c = 0; c <= 100; c++)
if (((a + b + c) == 20) && (10 * a + 5 * b + c == 100)) {
System.out.println("10元张数:" + a + ", 5元张数" + b + ", 1元张数:" + c);
count++;
}
System.out.println("一共有" + count + "种兑换方法。");
}
}