<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>枚举算法</title>
</head>
<script type="text/javascript">
var white,black,red;
for(red=1;red<=31;red++){
for(white=1;white<=31;white++){
for(black=1;black<31;black++){
if(red+white==25&&white+black==31&&red+black==28){
document.write("红:"+red+"白:"+white+"黑:"+black);
break;
}
}
}
}
<body>
</body>
</html>
网友评论