[恢]hdu 1339
2011-12-16 10:39:00
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1339
题意:给出n,输出o, p满足n == o*2^p,其中o是奇数。
代码:
# include <stdio.h>
int main ()
{
int n, p ;
scanf ("%d", &n) ;
while (~scanf ("%d", &n))
{
p = 0 ;
while (n % 2 == 0) n/=2, p++ ;
printf ("%d %d\n", n, p) ;
}
return 0 ;
}