题意
请参考LRJ白书第一章例题10
思路
试验小数据,找规律。
代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include <iostream> #include <algorithm> #include <queue> #include <vector> #include <cstdlib> #include <cstdio> #include <string> #include <cstring> #include <ctime> #include <iomanip> #include <cmath> #include <set> #include <stack> #include <cmath> #include <map> #include <complex> using namespace std; int main(){ long long a; while(scanf(" %lld",&a) != EOF){ int res = 0; long long fac = 1; while(fac <= a){ fac *= 2; res++; } printf("%d\n",res); } return 0; } |