hdu 5142 NPY and FFT
2015-06-08 18:07
183 查看
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5142
[code]#include<cstring> #include<cstdio> #include<cmath> int buf[40]; void go(int n) { int i, j = 0, res = 0; memset(buf, 0, sizeof(buf)); do buf[j++] = n % 2; while (n /= 2); for (i = j - 1; ~i; i--) res += buf[i] * (int)pow(2, j - i - 1); printf("%d\n", res); } int main() { int t, n; scanf("%d", &t); while (t--) scanf("%d", &n), go(n); return 0; }
相关文章推荐
- 个人拾遗!数组的拷贝等
- 程序员每天-7
- chroot详解
- 网盘的推广引流手段
- C#泛型在unity3D中的运用
- 使用VC++压缩解压缩文件夹
- 配置文件设置上传文件大小、超时时间等
- extern关键字
- CentOS 将网卡设置成eth0
- inotify-tools时实调用rsync同步文件
- Android 定位详解(显示自己想要的定位信息)
- Horizontal---ProgressBar
- [bootstrap] 修改字体
- Dispose的重写
- 《Linux内核设计与实现》读书笔记之进程地址空间
- ffmpeg学习(二) 通过rtsp获取H264裸流并保存到mp4文件
- linux命令
- [缓存]Linux系统memcached的安装
- 玩转iOS开发 - Runloop 详解
- 解决Secure CRT不能显示中文的BUG