JavaScript思维导图——Day 2(js中的运算符)

在这里插入图片描述今天js试例代码

<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<script type="text/javascript">
		// var score = parseInt(window.prompt('input'));

		// if (score > 90 && score <= 100) {
		// 	document.write('alibaba');
		// }

		// else if (score > 80 && score <= 90) {
		// 	document.write('tencnet');
		// }

		// else if (score > 70 && score <= 80) {
		// 	document.write('baidu');
		// }

		// else if (score > 60 && score <= 70) {
		// 	document.write('mogujie')
		// }

		// else if (score <= 60) {
		// 	document.write('byebye');
		// }

		// else {
		// 	document.write('error');
	 //    }
	 //阶乘
	 //    for(var i = 0; i < 10; i++) {
	 //    	document.write('a');
	 //    }
	 // var mul = 1;
	 // for(var i = score; i > 0; i--) {
	 // 	mul *= i;
	 // }
	 // document.write(mul);

   // 输出三个值的最大值
	//  var a = parseInt(window.prompt('input'));
	//  var b = parseInt(window.prompt('input'));
	//  var c = parseInt(window.prompt('input'));

	//  if (a > b) {
	//  	if (a > c) {
	//  		document.write(a);
	//  	}else{
	//  		document.write(c);
	//  	}
	//  }else {
	//  	if(b > c) {
	//  	document.write(b);
	//  }else {
	//  	document.write(c);
	//  }
	// }
	// 输出斐波那契数列
	// var n = parseInt(window.prompt('input'));
	// var one = 1;
	// var two = 1;
	// var three;

	// for(var i = 0; i < n-2; i++){
	// 	three = one + two;
	// 	one = two;
	// 	two = three;
	// 	}
	// document.write(three);
   // 输出1-100一以内的质数
 //    var count = 0;
	// for (var i = 2; i <= 100; i++) {
	// 	for (var j = 1; j <= Math.sqrt(i);j++)
	// 	{
	// 		if (i % j == 0) {
	// 			count++;
	// 		}
	// 	}
	// 		if (count == 1) {
	// 			document.write(i+" ");
	// 		}
	// 		count = 0;
	// 	} 


	</script>



</body>
</html>
发布了82 篇原创文章 · 获赞 21 · 访问量 2035

猜你喜欢

转载自blog.csdn.net/weixin_45174208/article/details/104162466
今日推荐