用ASP。net为小学生设计一个用于100以内的加法练习程序,程序启动后自动产生两个100以内的随机数显示在屏幕上,用户输入算式的答案后单击确定按钮程序显示出来并通过勾和叉给出评判

解决方案 »

  1.   

    刚学js,写的不好,复制下面代码到记事本,用ie打开
    <!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>
        <title>Untitled Page</title>    <script type="text/javascript">
        function getNum()
        {
            var num1=Math.round(Math.random()*100);
            var num2=Math.round(Math.random()*100);
            var o1=document.getElementById("num1");
            var o2=document.getElementById("num2");
            o1.value=num1;
            o2.value=num2;
            var o3=document.getElementById("t1");
            o3.value="";
        }
        function make()
        {
            var o3=document.getElementById("num3")
            var num3=o3.value;
            var o1=document.getElementById("num1");
            var o2=document.getElementById("num2");
            var num1= o1.value;
            var num2= o2.value;
            if(parseInt(num1)+parseInt(num2)==parseInt(num3))
            {
                var r1=document.getElementById("t1");
                r1.value="right!";
            }
            else
            {
                var r1=document.getElementById("t1");
                r1.value="wrong!";
            }
        }
        </script></head>
    <body>
        <table>
            <tr>
                <td>
                    <p class="waiweiwenzi">
                        第一个数:</p>
                </td>
                <td>
                    <input class="shuchu" type="text" readonly="readonly" id="num1" />
                </td>
            </tr>
            <tr>
                <td>
                    <p class="waiweiwenzi">
                        第二个数:</p>
                </td>
                <td>
                    <input class="shuchu" type="text" readonly="readonly" id="num2" />
                </td>
            </tr>
            <tr>
                <td>
                    <p class="waiweiwenzi">
                        结果:</p>
                </td>
                <td>
                    <input class="shuru" type="text" id="num3" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <input class="btn" id="btn1" type="button" value="做题" onclick="getNum()"/>
                </td>
                <td>
                    <input class="btn" id="btn2" type="button" value="提交" onclick="make()" />
                </td>
                <td>
                    <input class="jieguo" type="text" readonly="readonly" id="t1" />
                </td>
            </tr>
        </table>
    </body>
    </html>
      

  2.   

    lz这种问题你也到这来求教
    随机数你应会啊,rand(),弄几个按钮判断下结果比对
      

  3.   

    我刚写的,放在我博客里了http://blog.csdn.net/BossDarcy/archive/2010/11/29/6043934.aspx,测试正确了,还有我不懂的问题,如果你知道请帮忙解决一下