首页 > 代码库 > 杭电2175

杭电2175

 1 #include<stdio.h>
 2 int cus(int x,long long y)
 3 {
 4     long long temp = (long long)1<<(x-1);
 5     if(y == temp)
 6         return x;
 7     else if(y > temp)
 8         y-=temp;
 9     cus(x-1,y);
10 }
11 int main()
12 {
13     int a;
14     long long b;
15     while(~scanf("%d%lld",&a,&b) && a+b)
16         printf("%d\n",cus(a,b));
17 }

 

杭电2175