<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function init(){
document.getElementById("form").onsubmit=function(){
//string->int
var n=parseInt(document.getElementById("n").value);
//string->float
var m=parseFloat(document.getElementById("m").value);
var p=0;
//n
for(var i=0;i<=n;i++){
if(i==0){
p = m+i;
}else{
p *= m+i;
}
}
document.getElementById("result").innerHTML = "n="+n+", m="+m+", result: "+p;
return false;
}
}
</script>
</head>
<body onload="init();">
<form id="form" name="form" method="post" action="">
n=<input name="n" type="text" value="" id="n" /><br />
m=<input name="m" type="text" value="" id="m" /><br />
<input name="button" type="submit" value="ВИКОНАТИ" id="button" />
</form>
<br />
<div id="result"></div>
</body>
</html>