#include<bits/stdc++.h> using namespace std; int main() { double a = 10; cout << log10(a) << endl;//lg cout << log(a) << endl;//ln double b = 100; cout << log(b)/log(a) << endl;//a为底 return 0; }
输出
1 2.30259 2