#include<stdio.h> #include<math.h> int main() { int n,t; while(scanf("%d",&n)!=EOF) { double s=0; if(n==0) break; else { while(n%2==0) { s++; n=n/2; } t=pow(2,s); printf("%d\n",t); } } return 0; }
Double click to view unformatted code.