传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1192
求2^i > m的最小的i
#include <cstdio> int m; int main(void) { scanf("%d", &m); int i; for (i = 1; i < 32; ++i) { if ((1 << i) > m) { break; } } printf("%d ", i); return 0; }
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1192
求2^i > m的最小的i
#include <cstdio> int m; int main(void) { scanf("%d", &m); int i; for (i = 1; i < 32; ++i) { if ((1 << i) > m) { break; } } printf("%d ", i); return 0; }