1 条题解
-
212209水宇辰 (12209水宇辰) LV 9 @ 2021-12-23 20:27:26
#include <iostream> #include <cmath> using namespace std; int GetLength(double x); int main() { int n; cin>>n; double y=1; for(int x=2; x<=n; x++) y=y*x; cout<<GetLength(y)<<endl; return 0; } int GetLength(double x) { int n=0; while(x>=1) // !!!! n++, x/=10; return n; } int GetLength(int x) { int n; cin>>n; double len=0; for(int i=1; i<=n; i++) len += log(i)/log(10); cout << (int)len + 1; return 0; }
- 1
信息
- ID
- 1035
- 难度
- 6
- 分类
- (无)
- 标签
- 递交数
- 218
- 已通过
- 51
- 通过率
- 23%
- 上传者