数学题 求2^p-1的位数代码:
1 #include<iostream> 2 #include<string.h> 3 #include<stdio.h> 4 #include<cmath> 5 using namespace std; 6 7 int main() 8 { 9 int p; 10 while(cin>>p) 11 { 12 cout<<int(p*log10 (2.0))+1<<endl; 13 } 14 return 0; 15 }