1.请编写程序求出1~100之间的素数。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
		var flag=0;
		for(var j=1;j<101;j++){
			for(var i=2;i<j;i++){
				if(j%i==0){
					flag=1;
					break;
				}else{
					flag=0;
				}
			}
			if(flag==0&&j!=1){
				console.log(j);
			}
		}
	</script>
	</head>
	<body>
	</body>
</html>

2.有红、白、黑三种球若干个,其中红、白球共25个,白、黑球共31个,红、黑球共28个,求这三种球各有多少个?

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
	for(var red=0;red<25;red++)
	{
		var white=25-red,black=28-red;
		if (white+black==31)
		{
            document.write("Red:"+red+"\n"+"Black:"+black+"\n"+"White:"+white);
        }
	}
</script>
</head>
<body>
</body>
</html>