JavaScript 编程题
- null 和 undefined 的区别?
答:undefined:声明了变量,但是没有给这个变量赋值。
null:表示一个为空的值。
MySQL 编程题
SELECT username,sno FROM students GROUP BY username,sno HAVING
COUNT(course) = 1;
Java 编程题
- 打印出所有的「水仙花数」,所谓「水仙花数」是指一个三位数,其各位数字立方和等于该数本身。例如:153 是一个「水仙花数」,因为 153=1的三次方+5 的三次方+3 的三次方。
public class Work20171110 { public static void main(String[] args) {
for(int i = 100; i < 1000; i++) { int x = i / 100; int y = i /
10 % 10; int z = i % 10; if(x*x*x+y*y*y*y+z*z*z == i) {
System.out.println(“水仙花数:”+ i); } } }
}