编程素养-Day001

  • 如何用JavaScript编写九九乘法表,并显示到页面上
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>编程素养Day001-九九乘法表</title>
	</head>
	<body>
		<div id="cf"></div>
		<script>
			function test(){
				str = "";
				for (var x =1; x <= 9; x++) {
					for (var y = 1; y <=x; y++) {
						str + = y + "*" + x + "=" + y*x + "";
						if (y == x) {
							str + = "</br>";
			}
		}
	}
	document.getElementById("cf").innerHtml = str;
}
test ();
		</script>
	</body>
</html>

编程素养-Day001

  • 1、有一新记录(小王 13254748547 高中毕业2007-05-06),请用SQL语句新增至表中。
 insert into user (name,tel,content,date)  values("小王 ","13254748547","高中毕业","2007-05-06")
  • 2、请用 SQL 语句,把张三的时间更新为当前系统时间。
update user set Date=NOW() where name="张三";
  • 3、请写出删除姓名为张四的全部记录。
delete from user where name="张四";

Java 编程题
有 1、2、3、4 个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?

public class Test {
	public static void main (String args) {
	String str = "";
	for (int i = 1; i <=4; i++) {
		for ( int j = 1; j <= 4; j++) {
				if (i == j) {
				continue;
				}
				for (int k =1; k <=4; k++) {
					if (k == i || k == j) {
						continue;
					}
					str + = (i * 100 + j * 10 + k + ",");
				}
			}
		}
		System.out.print (0,str.length() - 1);
	}
}