DAY001

JavaScript 编程题

*如何用 JavaScript 编写九九乘法表,并显示到页面上?

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>九九乘法表</title>
    </head>
    <body>
        <div id="cf"></div>
        <script>
            function test() {
                var str = "";
                for(var x = 1; x <= 9; x++) {
                    for(var y = 1; y <= x; y++) {
                        str += y + "x" + x + "=" + y * x + " ";
                        if(y == x) {
                            str += "<br>";
                        }
                    }
                }
                document.getElementById("cf").innerHTML = str;
            }
            test();
        </script>
    </body>
</html>

MySQL 编程题

表名 User

nametelcontentdate
张三13333663366大专毕业2006-10-11
张四13333663366大专毕业2006-10-11
张五13333663366大专毕业2006-10-11

1、有一新记录(小王 13254748547 高中毕业2007-05-06),请用SQL语句新增至表中。

insert into User 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 个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?

package com.nt.test;

public class test1 {
	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(i==k||j==k)
					{
						continue;
					}
					 str += (i * 100 + j * 10 + k + ",");
				}
			}
		}
		  System.out.print(str.substring(0, str.length() - 1));
		  
	}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值