#G7C01. G7-1 数学库函数 课后练习

G7-1 数学库函数 课后练习

  1. [G7-样题-1]如果下面代码输入整数为10,输出是1,则横线处填写?()。
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    int x;
    cin >> x;
    cout << ________ << endl;
    return 0;
}

{{ select(1) }}

  • log10(x)\log_{10}(x)
  • sin(x)\sin(x)
  • exp(x)\exp(x)
  • pow(x,10)\mathrm{pow}(x,10)
  1. [G7-样题-7]定义double型常量pi=3.14和变量xxxx代表等边三角形边长,则该三角形的面积是()。 {{ select(2) }}
  • xxsin(pi/3)x*x*\sin(pi/3)
  • xxsin(pi/3)/2x*x*\sin(pi/3)/2
  • xxcos(pi/3)x*x*\cos(pi/3)
  • xxcos(pi/3)/2x*x*\cos(pi/3)/2
  1. [G7-2312-1]定义变量double x\mathrm{double}\ x,如果下面代码输入为100,输出最接近( )。
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    double x;
    cin >> x;
    cout << log10(x) - log2(x) << endl;
    cout << endl;
    return 0;
}

{{ select(3) }}

  • 00
  • 5-5
  • 8-8
  • 88
  1. [G7-2403-8]已知xxdouble\mathrm{double}类型的变量,且值大于0,则下列表达式的值一定大于0的是( )。 {{ select(4) }}
  • sin(x)/x\sin(x)/x
  • exp(x)x\exp(x)-x
  • log(x)x\log(x)-x
  • xxxx*x-x
  1. [G7-2406-1] 下列C++代码的输出结果是()。
#include <iostream>
#include <cmath>
using namespace std;
int main() {
    cout << sin(3.1415926 / 2);
    return 0;
}

{{ select(5) }}

  • 00
  • 11
  • 0.50.5
  • 0.70710.7071
  1. [G7-样题-16]定义变量double x=exp(1)\mathrm{double}\ x=\exp(-1),则x<0x<0为真。() {{ select(6) }}
  • 正确
  • 错误
  1. [G7-样题-17]假设xxyy都是double型正数,如果说xxyy大一个数量级,log(x/y)\log(x/y)等于10。() {{ select(7) }}
  • 正确
  • 错误
  1. [G7-样题-18]如果double型变量xx代表锐角对应的弧度角,则可以编程来确定sin(x)>cos(x)\sin(x)>\cos(x)的近似区间。() {{ select(8) }}
  • 正确
  • 错误
  1. [G7-样题-19]pow(1,2)\mathrm{pow}(1,2)返回的结果是浮点数。() {{ select(9) }}
  • 正确
  • 错误
  1. [G7-2312-16]小杨这学期准备参加GESP的7级考试,其中有关于三角函数的内容,他能够通过下面的代码找到结束循环的角度值。()
int main()
{
    double x;
    do{
        cin >> x;
        x=x/180*3.14;
    }while((int)(sin(x)*sin(x)+cos(x)*cos(x)) == 1);
    cout << "//" << sin(x) << " " << cos(x);
    cout << endl;
    return 0;
}

{{ select(10) }}

  • 正确
  • 错误