#3919. [GESP202312 七级 C++] 第 1 题

[GESP202312 七级 C++] 第 1 题

定义变量 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(1) }}

  • 0
  • -5
  • -8
  • 8