Lowest Bit
Lowest Bit
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 34 Accepted Submission(s) : 17
#include <stdio.h>
#include <stdlib.h>
#include <string.h> int main()
{
int num,sign,i,j,k,K,sum;
char num_2[],NUM_2[];
while()
{
scanf("%d",&num);
if(num==)break;
itoa(num,num_2,);
sign=strlen(num_2);
for(i=sign-,j=;i>=;i--)
{
if(num_2[i]!='')
{
NUM_2[j]='';
j++;
}
else
{
NUM_2[]='';
NUM_2[j]='\0';
break; }
}
k=strlen(NUM_2);
for(i=,sum=;i<k;i++)
{
sum*=;
}
printf("%d\n",sum); }
return ;
}
Lowest Bit的更多相关文章
- [LeetCode] Lowest Common Ancestor of a Binary Tree 二叉树的最小共同父节点
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- [LeetCode] Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的最小共同父节点
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- 48. 二叉树两结点的最低共同父结点(3种变种情况)[Get lowest common ancestor of binary tree]
[题目] 输入二叉树中的两个结点,输出这两个结点在数中最低的共同父结点. 二叉树的结点定义如下: C++ Code 123456 struct BinaryTreeNode { int ...
- [LeetCode]Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- 数据结构与算法(1)支线任务4——Lowest Common Ancestor of a Binary Tree
题目如下:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Given a binary tree, fin ...
- Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- leetcode 235. Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- leetcode 236. Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- LeetCode 【235. Lowest Common Ancestor of a Binary Search Tree】
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
随机推荐
- js的日期、定时器
第一.js的日期 js的日期是用内置对象Date来操作,首先先创建一个日期 var date=new Date();,然后就可以调用它的API来获取年月日.时分秒等等,这不是本文重点,本文重点讲如何把 ...
- Note_JavaWeb_MyBatis3
Jar包 mybatis-3.2.8.jar junit4.4.jar log4j-1.2.17.jar 常用类 Resources SqlSession SqlSessionFactory SqlS ...
- this的相关知识
一如既往,直接上代码: function fn(name,age){ var obj=new Object(); obj.name=name; obj.age=age; obj.talk=functi ...
- Scala并发编程
Scala的actor提供了一种基于事件的轻量级线程.只要使用scala.actors.Actor伴生对象的actor方法,就可以创建一个actor.它接受一个函数值/闭包做参数,一创建好就开始运行. ...
- Java参数传递问题
参考资料:http://blog.sina.com.cn/s/blog_59ca2c2a0100qhjx.html http://blog.csdn.net/a412588063/article/ ...
- flume-hdfs sinks报错
flume使用hdfs sinks时候报错:org.apache.flume.EventDeliveryException: java.lang.NullPointerException: Expec ...
- AIDL机制实现进程间的通讯实例
转载自:http://blog.csdn.net/cjjky/article/details/7562652 ======================================= 在Andr ...
- CSS3秘笈复习:第六章
第六章 1.文本大写化: text-transform:uppercase; 另外三种选项是:lowercase或capitalize以及none. 2.文本修饰: text-decoration:u ...
- jQuery复习:第五章
一.表单应用 1.表单验证: 首先创建一个表单: <form method="post" action=""> <div class=&quo ...
- 关于通过addClass与removeClass用jquery控制有良好兼容的CSS3样式
hi:)好久不见~最近被jquery的animate对某些CSS3特性不兼容搞的头晕眼花,果断百度,阅读了一些高手的博客后突然发现平常很少用到的addClass和removeClass属性居然还可以这 ...