zoukankan      html  css  js  c++  java
  • 课堂测试

    1.A   D  D  C(A因为设置一个初始值为0)D(改变数的类型)D(分母的数值每次变大2)D(因为sum的类型是double)

    2.D   A  B  C(D因为设置a【i】为整形)A(数组的初始值为0)B可以是输入有10个值C(获取最大值)

    3.

    #include<stdio.h>
    #include<math.h>
    int main(void)
    {
        double x,y;
        printf("The Enter x:");
        scanf("%lf",&x);
        if(x<-2){
            y=x*x;
        }
        else if(-2<=x&&x<=2){
            y=2+x;
        }
        else{
            y=sqrt(x*x+x+1);
        }
        printf("y=%.2f",y);
        return 0;
    }

    4.

    #include<stdio.h>
    int main(void)
    {
        int count,i,n,number,good;/*count表示不及格的人数,number表示合格人数,good表示优秀人数*/
        double grade;
        printf("The Enter n:");
        scanf("%d",&n);
        count=0;
        number=0;
        good=0;
        
        for(i=1;i<=n;i++){
            printf("The Enter grade:");    
            scanf("%lf",&grade);
            if(grade<60&&grade>0)
                count++;
            if(grade>60&&grade<84)
                number++;
            if(grade>84)
                good++;
            if(grade<0)
            printf("The enter is wrong
    ");
        }
            printf("The Number of failure=%d
    ",count);
            printf("The Number of pass=%d
    ",number);
            printf("The number of good=%d
    ",good);
    
        return 0;
    }
  • 相关阅读:
    python之sorted函数的三个参数
    python 局部变量和全局变量
    简单的理解https的连接过程
    关于web服务接口测试的一些问题及答案
    常用函数
    服务器并发处理能力
    JEMETER 录制
    resin
    loadrunner 计数器
    memcached and redis
  • 原文地址:https://www.cnblogs.com/shenyunwen/p/3398547.html
Copyright © 2011-2022 走看看