April Fools Contest 2017 B
2024-08-22 15:32:33
Description
Programmers' kids solve this riddle in 5-10 minutes. How fast can you do it?
Input
The input contains a single integer n (0 ≤ n ≤ 2000000000).
Output
Output a single integer.
Examples
input
11
output
2
input
14
output
0
input
61441
output
2
input
571576
output
10
input
2128506
output
3
化成16进制,然后数圈圈
#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
int a,b,c,d;
int main()
{
int ans;
cin>>ans;
if(ans==)
{
a++;
}
while(ans)
{
if(ans%==)
{
a++;
}
else if(ans%==)
{
a+=;
}
else if(ans%==)
{
a++;
}
else if(ans%==)
{
a++;
}
else if(ans%==)
{
a+=;
}
else if(ans%==)
{
a++;
}
else if(ans%==)
{
a++;
}
else if(ans%==)
{
a++;
}
ans/=;
}
cout<<a<<endl;
return ;
}
最新文章
- 那些年,坑死自己的事之fread/fwrite
- cefsharp设置网页接受语言Accept-Language
- 改变了一下blog的主题,很开心
- 【ToolGood.Words】之【StringSearch】字符串搜索——基于BFS算法
- pushState onpopstate
- 【转】 .NET中STAThread和MTAThread
- 怎么修改placeholder字体的css样式
- linux中怎样设置DHCP
- linux DHCP安装和测试
- Linux 下安装idea,提示svn版本太低问题
- the security settings could not be applied to the database(mysql安装error)【简记】
- leetcode刷题——一些算法技巧总结2.0
- python命令行运行py文件找不到模块的解决办法
- MySql 中文写入数据库乱码及Incorrect string value: &#39;\xF0\x9F...&#39; for column &#39;XXX&#39; at row 1解决
- Spark学习笔记——键值对操作
- LeetCode 965 Univalued Binary Tree 解题报告
- 关于VS2017的安装和WDK的选择问题
- LeetCode--108--将有序数组转化为二叉搜索树
- bzoj 1899 贪心+dp
- Openresty增加waf配置