201819102022段昕彤

在这里插入图片描述

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>测试试题</title>
</head>
<body>
<div style="line-height:20px">
<header>
  <h1>C语言测试试题</h1>
</header></div>
<form action="111.jsp" method="get">
  <h2>一、判断</h2><br>

  <table>
    <tr>
      <td></td><td>正确</td><td>错误</td>
    </tr>
    <tr>
      <td>1.单目运算符“&”是指针运算符</td><td> <input type="radio" name="pd1" id="pd1" value="1"></td><td><input type="radio" name="pd1" id="pd2"value="2"></td>
    </tr>
    <tr>
      <td>2.若fp是指向某文件的指针,若没到该文件的末尾,则函数feof(fp)的返回值是EOF</td><td> <input type="radio" name="pd2"value="1"></td><td><input type="radio" name="pd2"value="2"></td>
    </tr>
    <tr>
      <td>3.函数中的形参若为指针,则调用时对应位置上的实参不能是数组名</td><td> <input type="radio" name="pd3"value="1"></td><td><input type="radio" name="pd3"value="2"></td>
    </tr>
    <tr>
      <td>4.*&p与p一样</td><td> <input type="radio" name="pd4"value="1"></td><td><input type="radio" name="pd4"value="2"></td>
    </tr>
    <tr>
      <td>5.共用体变量的存储单元长度是最长分量的存储长度</td><td> <input type="radio" name="pd5"value="1"></td><td><input type="radio" name="pd5"value="2"></td>
    </tr>
  </table>
  <h2>二、选择</h2><br>
  <table>
    <tr><td colspan="4"> 1.结构化程序设计的3种结构是 </td></tr>
    <tr><td><input type="radio" name="xz1"value="1">A)顺序结构、选择结构、转移结构</td>
        <td><input type="radio" name="xz1"value="2">B)分支结构、等价结构、循环结构</td>
        <td><input type="radio" name="xz1"value="3">C)多分支结构、赋值结构、等价结构</td>
        <td><input type="radio" name="xz1"value="4">D)顺序结构、选择结构、循环结构</td></tr>
    <tr><td colspan="4"> 2.以下叙述中正确的是</td></tr>
    <tr><td><input type="radio" name="xz2"value="1">A)C语言比其他语言高级</td>
        <td><input type="radio" name="xz2"value="2">B)C语言可以不用编译就能被计算机识别执行</td>
        <td><input type="radio" name="xz2"value="3">C)C语言以接近英语国家的自然语言和数学语言作为语言的表达形式</td>
        <td><input type="radio" name="xz2"value="4">D)C语言出现的最晚,具有其他语言的一切优点</td></tr>
    <tr><td colspan="4"> 3.C语言中最简单的数据类型包括</td></tr>
    <tr><td><input type="radio" name="xz3"value="1">A)整型、实型、逻辑型</td>
        <td><input type="radio" name="xz3"value="2">B)整型、实型、字符型</td>
        <td><input type="radio" name="xz3"value="3">C)整型、字符型、逻辑型</td>
        <td><input type="radio" name="xz3"value="4">D)字符型、实型、逻辑型</td></tr>
    <tr><td colspan="4"> 4.若变量已正确定义并赋值,以下符合C语言语法的表达式是</td></tr>
    <tr><td><input type="radio" name="xz4"value="1">A)a:=b+1</td>
        <td><input type="radio" name="xz4"value="2">B)a=b=c+2</td>
        <td><input type="radio" name="xz4"value="3">C)int 18.5%3</td>
        <td><input type="radio" name="xz4"value="4">D)a=a+7=c+b</td></tr>
    <tr><td colspan="4"> 5.若变量a,i已正确定义,且i已正确赋值,合法的语句是</td></tr>
    <tr><td><input type="radio" name="xz5"value="1">A)a= =1; </td>
        <td><input type="radio" name="xz5"value="2">B)++i;</td>
        <td><input type="radio" name="xz5"value="3">C)a=a++=5;</td>
        <td><input type="radio" name="xz5"value="4">D)a=int(i);</td></tr>
  </table>
  <h2>三、多选</h2><br>
  1.已有char s[10][10];int i=10;。在下列表达式中,没有意义的表达式是:<br>
  <input type="checkbox" name="dx1" value="1">A.s[i][i]<br>
  <input type="checkbox" name="dx1"value="2">B.*(*(s+i)+i) <br>
  <input type="checkbox" name="dx1"value="3">C.*(&(s+i)+i)<br>
  <input type="checkbox" name="dx1"value="4">D.*(*(s+i-1)+i-1)<br>
  <input type="checkbox" name="dx1"value="5">E.*(*(s+i)+i-1)<br>
  2.若有int x,*px=&x; float y, *pf=&y;char c,*pc=&c;,下列正确的为<br>
  <input type="checkbox" name="dx2"value="1">A.px=(int *)pf; <br>
  <input type="checkbox" name="dx2"value="2">B.pc=(int *)px; <br>
  <input type="checkbox" name="dx2"value="3">C.px=(int *)pc;<br>
  <input type="checkbox" name="dx2"value="4">D.pf=(int *)px; <br>
  <input type="checkbox" name="dx2"value="5">E.pf=(float *)pc;<br>
  3.若有int *px; float *pf;char *pc;,下列关于指针的正确描述为<br>
  <input type="checkbox" name="dx3"value="1">A.px与pf存储单元长度一样<br>
  <input type="checkbox" name="dx3"value="2">B.px与pc存储单元长度一样<br>
  <input type="checkbox" name="dx3"value="3">C.pc与pf存储单元长度一样<br>
  <input type="checkbox" name="dx3"value="4">D.px、pc与pf三个变量的存储单元长度都一样<br>
  4.若有int x=3,*px; float y=3,*py;,则正确的赋值表达式是( )<br>
  <input type="checkbox" name="dx4"value="1">A、px=&x <br>
  <input type="checkbox" name="dx4"value="2">B、py=&x<br>
  <input type="checkbox" name="dx4"value="3">C、px=&y <br>
  <input type="checkbox" name="dx4"value="4">D、py=&y <br>
  5设有定义语句“int x=10, *p=&x”,则表达式的值为10的有( )<br>
  <input type="checkbox" name="dx5"value="1">A、p <br>
  <input type="checkbox" name="dx5"value="2">B、*p<br>
  <input type="checkbox" name="dx5"value="3">C、*&x <br>
  <input type="checkbox" name="dx5"value="4">D、*p=x <br>
  <input type="submit" value="提交">

</form>
</body>
</html>

在这里插入图片描述

<html>
<head>
    <title>得分</title>
</head>
<body>

<%  int sum=0;
    String t1=request.getParameter("pd1");
    String t2=request.getParameter("pd2");
    String t3=request.getParameter("pd3");
    String t4=request.getParameter("pd4");
    String t5=request.getParameter("pd5");
    String t6=request.getParameter("xz1");
    String t7=request.getParameter("xz2");
    String t8=request.getParameter("xz3");
    String t9=request.getParameter("xz4");
    String t10=request.getParameter("xz5");
    String t11[]=request.getParameterValues("dx1");
    String t12[]=request.getParameterValues("dx2");
    String t13[]=request.getParameterValues("dx3");
    String t14[]=request.getParameterValues("dx4");
    String t15[]=request.getParameterValues("dx5");
    if(t1==null)
    {

    }
    if (t1==null)
    {
        out.print("<p style='color:blue'>1.判断为正确</p>");
    }
    else if(t1.equals("1"))
    {
        out.print("<p style='color:green'>1.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>1.错误</p>");
    if (t2==null)
    {
        out.print("<p style='color:blue'>2.判断为正确</p>");
    }
    else    if(t2.equals("1"))
    {
        out.print("<p style='color:green'>2.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>2.错误</p>");
    if (t3==null)
    {
        out.print("<p style='color:blue'>3.判断为正确</p>");
    }
    else    if(t3.equals("1"))
    {
        out.print("<p style='color:green'>3.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>3.错误</p>");
    if (t4==null)
    {
        out.print("<p style='color:blue'>4.判断为正确</p>");
    }
    else    if(t4.equals("1"))
    {
        out.print("<p style='color:green'>4.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>4.错误</p>");
    if (t5==null)
    {
        out.print("<p style='color:blue'>5.判断为错误</p>");
    }
    else    if(t5.equals("2"))
    {
        out.print("<p style='color:green'>5.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>5.错误</p>");
    if (t6==null)
    {
        out.print("<p style='color:blue'>6.选择D</p>");
    }
    else    if(t6.equals("4"))
    {
        out.print("<p style='color:green'>6.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>6.错误</p>");
    if (t7==null)
    {
        out.print("<p style='color:blue'>7.选择C</p>");
    }
    else
    if(t7.equals("3"))
    {
        out.print("<p style='color:green'>7.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>7.错误</p>");
    if (t8==null)
    {
        out.print("<p style='color:blue'>8.选择B</p>");
    }
    else
    if(t8.equals("2"))
    {
        out.print("<p style='color:green'>8.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>8.错误</p>");
    if (t9==null)
    {
        out.print("<p style='color:blue'>9.选择D</p>");
    }
    else
    if(t9.equals("4"))
    {
        out.print("<p style='color:green'>9.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>9.错误</p>");
    if (t10==null)
    {
        out.print("<p style='color:blue'>10.选择B</p>");
    }
    else
    if(t10.equals("2"))
    {
        out.print("<p style='color:green'>10.正确</p>");
        sum+=5;
    }
    else
        out.print("<p style='color:red'>3.错误</p>");
    if (t11==null||t11.length<2)
    {
        out.print("<p style='color:blue'>11.应选A和D</p>");
    }
    else

    if(t11[0].equals("1")&t11[1].equals("4"))
    {
        out.print("<p style='color:green'>11.正确</p>");
        sum+=10;
    }
    else
        out.print("<p style='color:red'>11.错误,应选A和D</p>");
    if (t12==null||t12.length<3)
    {
        out.print("<p style='color:blue'>12.应选B、C、E</p>");
    }
    else
    if(t12[0].equals("2")&t12[1].equals("3")&t12[2].equals("5"))
    {
        out.print("<p style='color:green'>12.正确</p>");
        sum+=10;
    }
    else
        out.print("<p style='color:red'>12.错误,应选B、C、E</p>");
    if (t13==null||t13.length<4)
    {
        out.print("<p style='color:blue'>13.应选A、B、C、D</p>");
    }
    else
    if(t13[0].equals("1")&t13[1].equals("2")&t13[2].equals("3")&t13[3].equals("4"))
    {
        out.print("<p style='color:green'>13.正确</p>");
        sum+=10;
    }
    else
        out.print("<p style='color:red'>13.错误,应选A、B、C、D</p>");
    if (t14==null||t14.length<3)
    {
        out.print("<p style='color:blue'>14.应选A、B、D</p>");
    }
    else
    if(t14[0].equals("1")&t14[1].equals("2")&t14[2].equals("4"))
    {
        out.print("<p style='color:green'>14.正确</p>");
        sum+=10;
    }
    else
        out.print("<p style='color:red'>14.错误,应选A、B、D</p>");
    if (t15==null||t15.length<3)
    {
        out.print("<p style='color:blue'>15.应选A、B、D</p>");
    }
    else
    if(t15[0].equals("1")&t15[1].equals("2")&t15[2].equals("4"))
    {
        out.print("<p style='color:green'>15.正确</p>");
        sum+=10;
    }
    else
        out.print("<p style='color:red'>15.错误,应选A、B、D</p>");
    out.print("<p style='color:red;'><font size='100px;'>最后得分"+sum+"</font><p>");
%>

</body>

</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值