zoj 2722 Head-to-Head Match
来源:互联网 发布:3d全景拍照数据出错 编辑:程序博客网 时间:2024/06/10 11:42
#include<stdio.h>
int main(void)
{
unsigned int n,count,i;
while (scanf("%d", &n) && n)
{
count = 0;
while (n != 1)
{
if (n % 2 == 1) n++;
n /= 2;
count++;
}
printf("%d\n", count);
}
return 0;
}
int main(void)
{
unsigned int n,count,i;
while (scanf("%d", &n) && n)
{
count = 0;
while (n != 1)
{
if (n % 2 == 1) n++;
n /= 2;
count++;
}
printf("%d\n", count);
}
return 0;
}
0 0
- zoj 2722 Head-to-Head Match
- ZOJ 2722 Head-to-Head Match
- ZOJ 2722 Head-to-head match
- zoj 2722 Head-to-Head Match
- zoj 2722 Head-to-Head Match (睡前一水~)
- ZOJ Problem Set - 2722 Head-to-Head Match
- ZOJ2722Head-to-Head Match
- head
- head
- head
- head
- HEAD
- HEAD
- My first head to Blog
- PHP and ASP.NET Go Head-to-Head
- JavaServer Faces vs tapestry a head-to-head comparision
- Git HEAD & head
- Git HEAD^与HEAD~
- 自定义组合控件(密码锁的数字上下滚动效果)
- Leases租约机制完全理解手册
- 第二章 20
- P51 第二章第二十题
- 【Java并发编程】之九:死锁(含代码)
- zoj 2722 Head-to-Head Match
- Android Metro风格的Launcher开发系列第二篇
- Linux audit【daemon配置篇】
- 分类、扩展、延展(MS)如何创建category
- Servlet单例多线程分析
- 杭电 HDU ACM 1799 循环多少次?
- Python学习笔记———《字符串操作》
- linux Audit 介绍【架构篇】
- IOS object c基本语法 摘记